3 ms·
Making signed overflow to be well defined would be so much better. IIRC C++ just decided that signed numbers are two's complement and that's that. C could real
by sharpneli 6y ago
Making signed overflow to be well defined would be so much better.
IIRC C++ just decided that signed numbers are two's complement and that's that. C could really use similar thing.
- steerablesafe 6y ago> IIRC C++ just decided that signed numbers are two's complement and that's that. Signed integer overflow is still undefined in C++.
- sharpneli 6y agoYou are correct. I misremembered, it was just a proposal that was not taken into the spec.
- steerablesafe 6y agoNo, it's taken into the spec. It affects unsigned <-> signed conversions and maybe other things. Not integer overflow though.
- sharpneli 6y agoAh. Makes sense as that’s relatively cheap to emulate by just doing conversion when loading and storing from memory, but allows the use of HW even in case of ones complement implementation.