
The value of undefined behavior - OberstKrueger
https://nullprogram.com/blog/2018/07/20/
======
andreareina
The trouble is checking for undefined behavior (is adding these two ints going
to result in overflow?) without triggering said undefined behavior. Ideally
the checks would either be available as a function defined by the spec so that
the compilers can do the right thing depending on the architecture. Failing
that the compilers would have to pattern-match common idioms like they do for
other situations like exchanging two variables, rotating shifts, etc.

