From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7005 invoked by alias); 1 Dec 2004 11:55:37 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 6423 invoked from network); 1 Dec 2004 11:55:17 -0000 Received: from unknown (HELO web53208.mail.yahoo.com) (206.190.39.224) by sourceware.org with SMTP; 1 Dec 2004 11:55:17 -0000 Received: (qmail 5863 invoked by uid 60001); 1 Dec 2004 11:55:16 -0000 Message-ID: <20041201115516.5861.qmail@web53208.mail.yahoo.com> Received: from [203.199.129.130] by web53208.mail.yahoo.com via HTTP; Wed, 01 Dec 2004 03:55:16 PST Date: Wed, 01 Dec 2004 11:55:00 -0000 From: Name lastlong Subject: Re: Is this a bug in gcc?? To: Nathan Sidwell Cc: gcc-help@gcc.gnu.org In-Reply-To: <41ADA4DE.9060002@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-12/txt/msg00004.txt.bz2 Ok agreed! But don't you think that C compiler (gcc) also output this error? My observation is gcc outputs error only if we try to initialise both instant of "a". Regards. --- Nathan Sidwell wrote: > Name lastlong wrote: > > Hi, > > > > I am expecting a error (redefinition of "a") from > > following piece of code. But gcc (3.4.2) doesnot > give > > any error. > > ///////////////// > > int a; > > char b; > > int a; > > > > void foo(void) > > { > > return; > > } > > ///////////////// > > Instead, if we try initialising "a" at BOTH the > > places, then it gives error. > > VC++ gives this error anyway. > > VC++ is a C++ compiler, where the above is an error > gcc is a C compiler, where the above is not an error > > nathan > > -- > Nathan Sidwell :: http://www.codesourcery.com > :: CodeSourcery LLC > nathan@codesourcery.com :: > http://www.planetfall.pwp.blueyonder.co.uk > > __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail