title: Why are objects with automatic storage not zeroed when static objects are?
body: <p>In C, objects with automatic storage have an indeterminate value if they are not initialized, but static objects does not. From <a href="https://port70.net/~nsz/c/c11/n1570.html#6.7.9p10" rel="nofollow noreferrer">the standard</a>:</p>
  
  <blockquote>
    <p>If an object that has automatic storage duration is not initialized explicitly, its value is indeterminate. If an object that has static or thread storage duration is not initialized explicitly, then:</p>
    
    <ul>
    <li>if it has pointer type, it is initialized to a null pointer;</li>
    <li>if it has arithmetic type, it is initialized to (positive or unsigned) zero;</li>
    <li>if it is an aggregate, every member is initialized (recursively) according to these rules, and any padding is initialized to zero bits;</li>
    <li>if it is a union, the first named member is initialized (recursively) according to these rules, and any padding is initialized to zero bits; </li>
    </ul>
  </blockquote>
  
  <p>We all know that C is a pretty unforgiving language that gives all the responsibility to the programmer, so it makes me wonder a bit why they decided to zero initialize static objects. I also wonder why automatic arrays are completely zero initialized if and only if at least one element is manually initialized. But what makes me most curious is why they did not choose to do this either for everything or nothing.</p>
  
  <p>What is the rationale behind this?</p>