title: Werror doesn't make all warnings into errors
body: <p>In general, the flag <code>-Werror</code> is to make all warnings into errors. But it is not always the same.</p>
  
  <pre><code>int j;
  
  int main()
  {
      int i = 10; 
      return 0;
  }
  </code></pre>
  
  <p>If I type <code>g++ -Werror main.cpp</code>, there aren't any tips.<br>
  If I type <code>g++ -Wall main.cpp</code>, there is a warning:</p>
  
  <blockquote>
    <p>main.c: In function ‘main’: main.c:5:9: warning: unused variable ‘i’
    [-Wunused-variable]</p>
  </blockquote>
  
  <p>Can anyone explain it?</p>
  
  <p>Moreover, </p>
  
  <ol>
  <li>Why isn't there a warning about the variable <code>j</code>?</li>
  <li>How can I remove "warnings being treated as errors"?</li>
  </ol>
  
  <p>Thanks.</p>