This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bugs in simple for loop
- To: rssh at grad dot kiev dot ua
- Subject: Re: bugs in simple for loop
- From: Manfred Hollstein <manfred at s-direktnet dot de>
- Date: Thu, 14 Jan 1999 18:31:40 +0100 (MET)
- Cc: clee at rrkm dot ajou dot ac dot kr, egcs-bugs at cygnus dot com
- References: <199901141307.WAA01340@rrkm.ajou.ac.kr> <369E0816.15F907BD@Shevchenko.Kiev.UA>
- Reply-To: manfred at s-direktnet dot de, Manfred dot Hollstein at ks dot sel dot alcatel dot de
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