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: bugs in simple for loop


On Thu, 14 January 1999, 17:07:02, Ruslan@Shevchenko.Kiev.UA wrote:

 > ÀÌ Ãµ¿ì ±³¼ö (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 ?)

It does already:

$ gcc -c -W t.cc
t.cc: In function `int main()':
t.cc:6: warning: comparison of unsigned expression >= 0 is always true

manfred


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