4 ms·
That's the issue: while x86 exposes such operations, not all assembly dialects do. They too have to support C and emulating overflow detection in software would
by saagarjha 8y ago
That's the issue: while x86 exposes such operations, not all assembly dialects do. They too have to support C and emulating overflow detection in software would be unreasonable.
- acqq 8y agoIt seems to me that it would not be unreasonable. If you need that detection, you need it at any price, on any platform. If you don't need it, meaning, the code doesn't test it, the compiler has still the right to optimize it away.
- saagarjha 8y agoSo it would be implementation defined behavior. I'm fine with that; personally, I think the standard was too quick to assign "undefined" here. But it can't mandate a certain behavior in the standard across all platforms.