Bug#157416: _Pragma() from macros - bug

2002-08-29 Thread Zack Weinberg
This was reported to the Debian bug-tracking system: $ cat foo.c _Pragma("foo"); int y; #define FOO _Pragma("foo"); int x; FOO [EMAIL PROTECTED]:~$ cpp-3.2 foo.c # 1 "foo.c" # 1 "" # 1 "" # 1 "foo.c" # 1 "foo.c" #pragma foo # 1 "foo.c" ; int y; # 3 "foo.c" #pragma ; int x;foo >

Bug#158704: gcc: gcc compiles incorrect loop

2002-08-29 Thread Carlos O'Donell
> >The issue is a rather pedantic one. Should an error be generated > >by the compiler indicating that 'return 0' can never be reached? > > Not an error because the code is in fact correct, but a warning about > unreachable code would be nice. > > Regards, > Bart > Originally this had appeared

Bug#158704: gcc: gcc compiles incorrect loop

2002-08-29 Thread Bart Samwel
Carlos O'Donell wrote: int main() { int a = 0; while (a == 0) { a = 1; } while (1) /* Do nothing */ ; return 0; } The issue is a rather pedantic one. Should an error be generated by the compiler indicating that 'return 0' can never be reached? Not an error because the code is in fact c

Bug#158704: gcc: gcc compiles incorrect loop

2002-08-29 Thread Carlos O'Donell
> Eugene, > > This code is completely correct as far as I can see. The second while is > interpreted as a new while loop, and the closing; is short for {} in > this case. I've expanded the code into a more intuitive form here: > > int main() > { > int a = 0; > > while (a == 0) { > a =

Bug#158704: gcc: gcc compiles incorrect loop

2002-08-29 Thread Bart Samwel
Eugene, This code is completely correct as far as I can see. The second while is interpreted as a new while loop, and the closing; is short for {} in this case. I've expanded the code into a more intuitive form here: int main() { int a = 0; while (a == 0) { a = 1; } while (1) /*