2 ms·
Is there a reason why the language doesn't provide UB-on-overflow (and wrappring overflow) for both unsigned and signed types? It always feels dirty deliberate
by account42 4y ago
Is there a reason why the language doesn't provide UB-on-overflow (and wrappring overflow) for both unsigned and signed types?
It always feels dirty deliberately using a signed type for something you know can never be neagtive just because that signed type has other properties you want.
- anfilt 4y agoThe newest C standard will define signed integers as 2's complement. Getting rid of this instance of UB. https://en.wikipedia.org/wiki/C2x https://en.wikipedia.org/wiki/C2x