title: Static initialize struct to zero
body: <p>more basic approach:</p>
  
  <pre><code>struct TEST
  {
      float c;
      unsigned int c1;
      double c2[5];
  } t = {0};
  </code></pre>
  
  <p>gives the warning:</p>
  
  <blockquote>
    <p>warning: missing initializer for field 'c1' of 'struct TEST' [-Wmissing-field-initializers]</p>
  </blockquote>
  
  <p>while setting C to int, long, char (but NOT array) etc...</p>
  
  <p>with array it gives warning:</p>
  
  <blockquote>
    <p>warning: missing braces around initializer [-Wmissing-braces]</p>
  </blockquote>
  
  <p>was:
  I have the following line like this:</p>
  
  <pre><code>#define ADD_STRUCT_TO_ARRAY(xu) X(xu, &amp;(struct xu){})SEP
  </code></pre>
  
  <p>which is needed because that structs have to be initialized in many places. But it gives me the warning:</p>
  
  <blockquote>
    <p>warning: missing initializer for field 'a1' of 'struct A' [-Wmissing-field-initializers]</p>
  </blockquote>
  
  <p>by C99 standard it should initialize to zero and get rid of the warning?</p>
  
  <p>changing to </p>
  
  <pre><code>#define ADD_STRUCT_TO_ARRAY(xu) X(xu, &amp;(struct xu){0})SEP
  </code></pre>
  
  <p>get ALMOST rid of the warning but NOT IF the first element of the struct is a float or double.</p>
  
  <p>any idea what is going on?, also setting 0.0 seems not helpful</p>