------- Comment #4 from ian at airs dot com 2007-12-13 20:37 ------- Note that this gives a warning with -Wstrict-overflow.
And note that you get the desired behaviour if you compile with -fno-strict-overflow. As Pinski says, the code is simply incorrect according to standard C, but you can use the -Wstrict-overflow and -fno-strict-overflow options to help fix existing code bases. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34454