2 ms·
> The amount of code that can break as a result of signed overflows being UB, on the other hand, is huge C++ recently decided to not make signed overflow defin
by MauranKilom 5y ago
> The amount of code that can break as a result of signed overflows being UB, on the other hand, is huge
C++ recently decided to not make signed overflow defined, despite having the explicit opportunity to do so. Here is the reasoning:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html#r0r1 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p090...
> Performance concerns, whereby defining the behavior prevents optimizers from assuming that overflow never occurs;
> Implementation leeway for tools such as sanitizers;
> Data from Google suggesting that over 90% of all overflow is a bug, and defining wrapping behavior would not have solved the bug.
Presumably, data from Google disproves your assertion that the amount of code that breaks due to signed overflow being UB is huge.