This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug in gcc




On Sat, 26 Aug 2000, Mo McKinlay wrote:

> 
>   > Hi,
>   >     I noticed this bug in gcc of versions 2.95.1, 2.7.2.3, 2.8.1, and
>   > egcs-2.91.66.
>   > 
>   > If I have a two statements in a  header file as follows:
>   > 
>   > int  NOM_CURVATURE = 35;
>   > #define  NOM_CURVATURE  35
>   > 
>   > 
>   > the gcc compiler accepts this !!
> 
> It should. There's nothing wrong with those statements, provided they
> appear in that order. The only problems would arise if you did:
> 
> NOM_CURVATURE = 36;
> 
> At which point the preprocessor would turn it into:
> 
> 35 = 36;
> 
> Which is obviously a syntax error.

I tried exactly that:

int  NOM_CURVATURE = 35;
#define  NOM_CURVATURE  36


 and it is still not giving an error. 

Program execution shows the value of NOM_CURVATURE as 36.

thanks
- Nil


> 
> -- 
> Mo McKinlay             Chief Software Architect          inter/open Labs
> -------------------------------------------------------------------------
> GnuPG Key: pub  1024D/76A275F9 2000-07-22 Mo McKinlay <mmckinlay@gnu.org>
> 
> 
> 
> 
> 
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]