4 ms·
> I pretty much agree with your point that the main problem is there is no way to work around UB; if there were a workaround there would be much less reason to
by zajio1am 5y ago
> I pretty much agree with your point that the main problem is there is no way to work around UB; if there were a workaround there would be much less reason to complain.
There is a canonical workaround - cast operands to unsigned integer, do the operation, cast it back to signed integer. Overflow during casting to signed is implementation-defined behavior instead of UB.