The problem, as Regehr (the author of this submission) has pointed out many times before, is more subtle than that. Because certain behavior is considered undefined, compilers are allowed to assume the code it is compiling <i>is</i> well defined, and optimize accordingly. That can cause simple bugs to have mysterious effects. For example:<p><pre><code>    a-&gt;thing = 42;
    if (a == NULL) {
      return;
    }
</code></pre>
Obviously that code is wrong; I should check for NULL before using a. But because I dereferenced a, the compiler can assume a must not be NULL, and just removes the null check as dead code. This scenario has caused problems in the kernel, and made bad bugs even worse.