News for hackers. Stuff that matters.
Re:Signed Integers Are Two’s Complement by greenhouse_gas on Thursday May 31, 2018 @12:17PM (#17197504)
>It's undefined because in the majority of situations, it is the result of a bug,

1. If it's a bug, it should overflow or crash (implementation defined, not undefined), or do what Rust does, crash on -o0 (or, if it's illegal to change defined behavior based on optimization level, create a --crash-on-overflow flag) and overflow on everything else.

2. There is plenty of code where it's intentional (such as the infamous if(a+5<a)).

There are no comments on this comment yet.