That&#x27;s shoddy programming - it obviously contains an error.<p>As someone who compiles with &quot;-Wall -Wextra -Werror&quot;, I believe that this example program shouldn&#x27;t even be allowed to compile, even though the standard allows it.<p>The variable should really be initialized explicitly, which shouldn&#x27;t be expensive at runtime.<p><pre><code>    int i = 1;  &#x2F;* or whatever *&#x2F;
</code></pre>
Alternately, if the programmer intended to only print when some_big_complicated_function() return true - which is a strong possibility because they only wrote a value to &quot;i&quot; for that case - then the bug is in the position of the printf and possibly the variable definition, if you&#x27;re using &gt;=C99.<p><pre><code>    #include &lt;stdlib.h&gt;
    #include &lt;stdio.h&gt;

    int some_big_complicated_function(void);

    int main() {
        if (some_big_complicated_function()) {
            int i = 0;
            printf(&quot;%d\n&quot;, i);
        }

        return EXIT_SUCCESS;
    }
</code></pre>
&gt; the resulting program would go much, much slower due to all the checks.<p>That depends on a lot. It can be (very) significant if you&#x27;re talking about the middle of a hot loop; in the given example that runs once per main(), the difference is negligible.<p>For better examples and a discussion of why it can be very hard to issue <i>useful</i> warnings when optimizing around undefined behavior, see LLVM&#x27;s series of articles that should is mandatory reading for anybody working with C&#x2F;C++.<p>1&#x2F;3 - <a href="http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-know.html" rel="nofollow">http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-...</a><p>2&#x2F;3 - <a href="http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-know_14.html" rel="nofollow">http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-...</a><p>3&#x2F;3 - <a href="http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-know_21.html" rel="nofollow">http:&#x2F;&#x2F;blog.llvm.org&#x2F;2011&#x2F;05&#x2F;what-every-c-programmer-should-...</a>