News for hackers. Stuff that matters.
Re:Undefined Behavior in 2017 by petergeoghegan on Wednesday July 05, 2017 @01:27PM (#14704398)
It can be, but it isn't. All contemporary ISAs use two's complement arithmetic for signed integers, including x86-64, and so I think signed overflow could be made well defined on all archs without particularly disadvantaging one arch over the other.

The reason that that doesn't happen, here as elsewhere, is that there are a number of specific compiler optimizations that rely on it being undefined. See GCC's -fwrapv flag.

There are no comments on this comment yet.