------- Comment #2 from pinskia at gcc dot gnu dot org 2009-01-01 15:53 ------- This code is undefined as you would have an integer overflow which is undefined by both the C and C++ standards.
You can use -fwrapv for wrapping of signed integers or cast to unsigned before doing the addition. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID Version|4.0 |4.3.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38687