title: Why does `int ;` compile fine in C, but not in C++?
body: <p>Consider the following program (see live demo <a href="http://ideone.com/504P4P">here</a>).</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void)
  {
        int ;  // Missing variable name
        puts("Surprise");
  }
  </code></pre>
  
  <p>My compiler, gcc 4.8.1, gives the below warning:</p>
  
  <blockquote>
    <p>[Warning] useless type name in empty declaration [enabled by default]</p>
  </blockquote>
  
  <p>Why does it compile fine? Shouldn't I get a compiler error? g++ 4.8.1 gives the following error when I compile it as a C++ program:</p>
  
  <blockquote>
    <p>[Error] declaration does not declare anything [-fpermissive]</p>
  </blockquote>