title: Detecting semicolon after loop/if brackets
body: <p>Is there any flag in GCC (like <code>-Wempty-body</code> in clang), that could help me detect semicolons after the braces of while/for loops? Sometimes it is very hard for humans to find these simple mistakes. </p>
  
  <pre><code>int i = 0;
  for (i = 0; i &lt; 10; ++i);
  {
      cout &lt;&lt; i &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I use GCC 4.7.3 and clang 3.2-1~exp9ubuntu1.</p>
  
  <p>Edited:
  I also check if compilers could help me find these mistakes after "if-else statements".</p>
  
  <pre><code>if (i == 0)
  {
      cout &lt;&lt; i &lt;&lt; endl;
  }
  else;
  {
      cout &lt;&lt; i &lt;&lt; endl;
  }
  </code></pre>
  
  <p>What is interesting gcc is more helpful than clang (with this flags (<code>-Wall -pedantic -Wempty-body</code>) by printing warning:</p>
  
  <pre><code>main.cpp:30:9: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
  </code></pre>