Undefined behavior is primarily something that that has effects, rather than at compile time.  For example, taking the value of an uninitialized local variable.<p><pre><code>    int main() {
        int i;
        if(some_big_complicated_function()){
            i = 0;
        }
        printf(&quot;%d\n&quot;,i);
    }
</code></pre>
Is this undefined behavior?  The compiler can&#x27;t be sure, because it can&#x27;t know whether `some_big_complicated_function()` returns true or not.<p>Therefore, it would need to be a runtime check, rather than a compile time check.  But runtime checks are expensive, and so it typically isn&#x27;t done.  It would be entirely allowed by the standard to give such a warning at runtime, but the resulting program would go much, much slower due to all the checks.