infinite for-loop and related question

Jason Mancini jayrusman@hotmail.com
Wed Feb 16 20:17:00 GMT 2011


Hello,
So as I recall, the following can be an infinite loop now with optimizations, right?

  for (int i(1); i!=0; ++i) { ... }

What about:

  unsigned int x = 0xFFFFFFFFU;
  x = x+1;
  if (x) { ... can we get here because "positive x + 1 must still positive"? ... }

If not, given the first, why not?
Thanks,
Jason Mancini 		 	   		  



More information about the Gcc-help mailing list