This is the mail archive of the gcc@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


In article <199901141307.WAA01340@rrkm.ajou.ac.kr>,
clee@rrkm.ajou.ac.kr (ÀÌ Ãµ¿ì ±³¼ö (x2606)) writes:
> 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 is normally a unsigned type, so i >= 0 is always true. If you
would have compiled with -Wall gcc would have told you. 


-Andi


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