Important warning missing, was Re: bugs in simple for loop

Marc Espie
Tue Jan 19 01:45:00 GMT 1999

In article < 369E0816.15F907BD@Shevchenko.Kiev.UA > you write:
>ÀÌ Ãµ¿ì ±³¼ö (x2606) wrote:

>> Dear Sir, Today I found a striking bug. It occurs in the very simple
>> situation like the following.

>>         #include <cstddef>
>>         #include <iostream>

>>   main(){
>>                 for(size_t i = 9; i >= 0 ; i-- ) cout << i << endl;
>>         }

>size_t    *always*   >=0.

>So, this is not bug.

>(Hmm, is egcs produce warning here ?)

No, it doesn't... which is kind of weird, considering it does detect
the condition can never be fullfilled, as the assembler output of
g++ -Wall -O2  clearly shows.

More information about the Gcc-bugs mailing list