News for hackers. Stuff that matters.
Re:Tell HN: C Experts Panel – Ask us anything about C by colanderman on Tuesday April 14, 2020 @10:29AM (#22866395)
Beside optimization (as others have pointed out), disallowing wrapping of signed values has the important safety benefit that it permits run-time (and compile-time) detection of arithmetic overflow (e.g. via -fsanitize=signed-integer-overflow). If signed arithmetic were defined to wrap, you could not enable such checks without potentially breaking existing correct code.

There are no comments on this comment yet.