title: Is it wise to ignore gcc/clang's "-Wmissing-braces" warning?
body: <p>Consider the following program:</p>
  
  <pre><code>#include &lt;array&gt;
  
  int main()
  {
    std::array&lt;int, 1&gt; x = { 0 }; // warning!
    x = { { 0 } }; // no warning
    return 0;
  }
  </code></pre>
  
  <p>The first initialization leads to warnings on gcc 4.7.2...</p>
  
  <pre><code>main.cpp:5:22: warning: unused variable ‘x’ [-Wunused-variable]
  </code></pre>
  
  <p>... and clang 3.1</p>
  
  <pre><code>main.cpp:5:28: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    std::array&lt;int, 1&gt; x = { 0 };
  </code></pre>
  
  <p>As far as the standard goes, there should be no difference between double or single curly braces, at least in this example.</p>
  
  <p>There are two ways to deal with the warning:</p>
  
  <ol>
  <li>Just turn it off</li>
  <li>Fix the code, so the compiler is happy</li>
  </ol>
  
  <p>What do you propose? IMHO, the double curly expression looks somewhat ugly. On the other hand, the warning might detect real problems in more complicated examples. Do you know an example where the warning would have helped you?</p>