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


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/



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