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: egcs-bugs at cygnus dot com
- Subject: Re: bugs in simple for loop
- From: Stefan Drees <sdrees at qwdb dot rs dot kp dot dlr dot de>
- Date: Thu, 14 Jan 1999 15:40:16 +0100 (MET)
- cc: ÀÌ Ãµ¿ì ±³¼ö <clee at rrkm dot ajou dot ac dot kr>
- Reply-To: Stefan Drees <Stefan dot Drees at dlr dot de>
Hi,
looks like size_t is an unsigned type, isn't it?
:-) Dear Sir, Today I found a striking bug. It occurs in the very simple
...
:-) for(size_t i = 9; i >= 0 ; i-- ) cout << i << endl;
:-)
...
:-) This simple program when run prints out from very large number 42949656....
...
:-) then the program works O.K. (the difference is in ">=" and ">" ).
Later,
s t e f a n.
---
Day: Stefan Drees <sdrees@acm.org>, Phone ++49 2203 601 - 3542
Night: Stefan Drees <sdrees@manchmal.rhein.de>, Phone ++49 228 934 35 14
Browse: http://www.sdrees.de/stefan/