Is this a bug in gcc??

Name lastlong brew_pt@yahoo.com
Wed Dec 1 11:55:00 GMT 2004


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 <nathan@codesourcery.com> 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



More information about the Gcc-help mailing list