title: Initialize struct members to 0 (gcc -Wextra)
body: <p>I want to initialize all struct members to 0. Common solution is to make something like this:</p>
  
  <pre><code>struct foo bar = {0}
  </code></pre>
  
  <p>I create this example:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  struct Stru2 {
      int c;
      int d;
  };
  
  struct Stru1 {
      int a;
      Stru2 b;
  };
  
  int main()
  {
      struct Stru1 aaa = { 0 };
      return aaa.b.c;
  }
  </code></pre>
  
  <p>And I compile (gcc 4.6.3) it whit this parameters, to make sure how ANSI handle this</p>
  
  <pre><code>gcc -Wall -Wextra -pedantic -ansi main.cpp
  </code></pre>
  
  <p>And I got following warnings:</p>
  
  <pre><code>main.cpp: In function ‘int main()’: 
  main.cpp:36:28: warning: missing initializer for member ‘Stru1::b’ [-Wmissing-field-initializers]
  </code></pre>
  
  <p>The question is, why <strong>-Wextra</strong>, generate this warning? Maybe not always "= {0}", set all members to 0?</p>