4 ms·
Guaranteed 2 complement arithmetic for signed integers was recently added to C++. Wrap around is still UB though because apparently caused regressions in some s
by gpderetta 5y ago
Guaranteed 2 complement arithmetic for signed integers was recently added to C++. Wrap around is still UB though because apparently caused regressions in some significant code bases.
Guaranteed order of evaluation of arguments almost made it into the standard, but because of regressions, we didn't quite get the full benefits; for example:
i = i++ + 2;
is now fully defined, while this:
f(++i, ++i);
is no longer UB, but implementation defined.
Ideally for every UB taken away we would get one or more pragmas to get the optimization back like ivdep. The issue is that that doesn't help old code bases.
- WalterBright 5y agoD also guarantees left to right evaluation order. > The issue is that that doesn't help old code bases. D has a flag called -revert=issue where old behaviors will be supported for a time.