Comment by somat
3 years ago
Why can they assume that? how on earth did "undefined" ever get read as "can not happen"? if the standard meant "can not happen", they would have said "can not happen". but they did not, they said we are not going to define what is going to happen. or in other words, the cpu is going to do something when this happens but we don't know what.
Nothing in there lets the compiler get to say "this will never happen". but they do exactly this.
Because compilers only work with programs that have well-formed executions.