Bug#158704: gcc: gcc compiles incorrect loop

2002-12-28 Thread Matthias Klose
reassign 158704 gcc-2.95 retitle 158704 [fix in 3.2] gcc doesn't warn about unreachable code tags 158704 + fixed thanks $ gcc-3.2 -Wall -W -Wunreachable-code bug-158704.c bug-158704.c: In function `main': bug-158704.c:12: warning: will never be executed Carlos O'Donell writes: > > >The issue is a

Processed: Re: Bug#158704: gcc: gcc compiles incorrect loop

2002-12-28 Thread Debian Bug Tracking System
Processing commands for [EMAIL PROTECTED]: > reassign 158704 gcc-2.95 Bug#158704: gcc: gcc compiles incorrect loop Bug reassigned from package `gcc' to `gcc-2.95'. > retitle 158704 [fix in 3.2] gcc doesn't warn about unreachable code Bug#158704: gcc: gcc compiles incorrect l

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) /*

Bug#158704: gcc: gcc compiles incorrect loop

2002-08-28 Thread Eugene Morozov
Package: gcc Version: 2:2.95.4-16 Severity: normal gcc compiles following program without emitting warning even with -Wall -ansi -pedantic. gcc-3.2 also compiles this program. int main() { int a = 0; while (a == 0) { a = 1; } while (1); return 0; } -- System Information Debian