by to3m · 10y ago · 0 comments
(This is explicitly allowed by the standard. Consult its definition of undefined behaviour.)
Why not create a compiler that does what your users want? Why spend your time creating a stick to beat them with?
I think this is a highly suspicious assumption. Programmers don't write code for no reason; they have a mental model of the current state of parameters and variables, and establish invariants as they write loops and conditionals. If you're going to start throwing out chunks of code the programmer wrote, you need to be certain - not merely unsure, but certain - that the code is dead. Infectious undefined values that propagate through data flow to break code flow isn't a sane programming environment.