4 ms·
Are there any machines in widespread use today that don't use two's complement? I guess if there were, we'd hear a lot more about this issue... I know that some
by userbinator 13y ago
Are there any machines in widespread use today that don't use two's complement? I guess if there were, we'd hear a lot more about this issue... I know that some mainframes are an example, but they're somewhat of a niche.
- nitrogen 13y agoSigned integer overflow is undefined in C, so optimizers can do really weird things to code that has overflows.
- anaphor 13y agoYes, see: http://people.csail.mit.edu/nickolai/papers/wang-undef.pdf http://people.csail.mit.edu/nickolai/papers/wang-undef.pdf
- kps 13y agoAnd see John Regehr's ( http://blog.regehr.org/ http://blog.regehr.org/, of the headline article) other posts. He's written a great deal about undefined behaviour in C/C++ and how modern compilers handle it. Check the ‘Compilers’ and ‘Software Correctness’ categories.