> You can't turn hitting that undefined behaviour into a compiler error, as distinguishing between the two requires solving the halting problem.
That's a fair point, but it still feels wrong to me that the compiler can throw away large chunks of code and change the outcome of the function silently.
That's a fair point, but it still feels wrong to me that the compiler can throw away large chunks of code and change the outcome of the function silently.