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: gcc bug? or how can I learn to get rid of '#define' and love'const'?




On Tue, 1 Feb 2000 lxl@my-deja.com wrote:

> I have a very simple helloworld to try global constants:
> 
> ////////////// start of code //////////////
> 
> //
> // const.c
> //
> // test const globals
> 
> #include <stdio.h>
> 
> const int firstglobalint = 100;
> const int secondglobalint = firstglobalint;
> 
> int
> main()
> {
>     const int firstlocalint = 100;
>     const int secondlocalint = firstlocalint;
> 
>     printf("hello world with 1st %d and 2nd %d!\n", firstlocalint,
> secondlocalint);
> 
>     return 0;
> }
> 
> //////////////// end of code ////////////////
> 
[snip]

2.95.2 compiles this fine. Upgrade early, upgrade often.


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