On efficiency<p>The compiler cannot rely on the stack (or registers) to be zero, so there has to be a instruction to set it to zero anyways.<p>However, setting a register to zero is a special case and your hardware might be optimized for it.<p><a href="https:&#x2F;&#x2F;randomascii.wordpress.com&#x2F;2012&#x2F;12&#x2F;29&#x2F;the-surprising-subtleties-of-zeroing-a-register&#x2F;" rel="nofollow">https:&#x2F;&#x2F;randomascii.wordpress.com&#x2F;2012&#x2F;12&#x2F;29&#x2F;the-surprising-...</a><p>Maybe setting to zero would faster. However, if you optimize on that level, then you can optimize by hand as well. Set it to zero explicitly or even let it uninitialized explicitly:<p><pre><code>    int x = void;</code></pre>