News for hackers. Stuff that matters.
Re:Tell HN: C Experts Panel – Ask us anything about C by colanderman on Tuesday April 14, 2020 @11:12AM (#22866950)
You can enable this in GCC on a compilation unit basis with `-fsanitize=signed-integer-overflow`. In combination with `-fsanitize-undefined-trap-on-error`, the checks are quite cheap (on x86, usually just a `jo` to a `ud2` instruction).

(Note that while `-ftrapv` would seem equivalent, I've found it to be less reliable, particularly with compile-time checking.)

Re:Tell HN: C Experts Panel – Ask us anything about C by corndoge on Tuesday April 14, 2020 @12:02PM (#22867585)
And clang!