This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/18700] Infinite loop with ranged for() loop
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Nov 2004 05:27:36 -0000
- Subject: [Bug c/18700] Infinite loop with ranged for() loop
- References: <20041128052103.18700.sa2c@sa2c.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-28 05:27 -------
In C, ((int)INT_MAX) + 1 is undefined and int does not wrap.
For 3.4.0 and above if you want int to wrap use the flap -fwrapv.
Otherwise use unsigned where wrapping is defined.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18700