3 ms·
Yup you are right on that, but the obvious way to check for overflow is UB so gets optimized out. Many security bugs in code people thought was correct. The cor
by olliej 8y ago
Yup you are right on that, but the obvious way to check for overflow is UB so gets optimized out. Many security bugs in code people thought was correct. The correct, standard compliant non-UB way to check for the overflow requires a zero check and a division. It’s super non obvious. I like to imagine C committee has made standardized definition for the current builtins but I also have low expectations.