------- Comment #11 from ismail at pardus dot org dot tr 2008-01-18 03:10 ------- Actually the only bug here is that -Wstrict-overflow should issue a warning for that line.
About the dependency on optimization level, signed integer overflow is undefined in C standard so its not a good idea to depend on it. What GCC does is exploiting this fact for optimizations which is fine. What -fwrapv does that it defines wrapping for signed integer overflow. I hope this makes the issue more clear. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34841