Classic example: signed integer overflow. It worked for decades. Then one day it didn't.
If you want to know about this particular example: https://news.ycombinator.com/item?id=6824514 (not personally confirmed)
Classic example: signed integer overflow. It worked for decades. Then one day it didn't.
If you want to know about this particular example: https://news.ycombinator.com/item?id=6824514 (not personally confirmed)
Compiler users generally want something that "just works" and doesn't do anything unexpected, but in the case of a low-level language like C, doing away with undefined behavior essentially would mean pessimistically avoiding many optimisations on the 99%+ of straightforward, reasonable code out there in favor of not doing anything surprising on the remaining fraction of dubious code that depends on certain things happening in scenarios where behavior is undefined according to the C standard. There are languages that make that choice, but C isn't one of them.
I have fixed feelings about the integer overflow issue because it's so easy to trigger, unlike triple post increment fake examples. And it usually results in a security problem. For very little benefit, IMO.