title: Semicolon at the ends of if-statements and functions in C
body: <p>I just ran into some code that overuse semicolons, or use semicolon for different purposes that I am not aware of.</p>
  
  <p>I found semicolons at the end of if-statements and at the end of functions. For instance:</p>
  
  <pre><code>int main (int argc, char * argv[]) {
      // some code
  
      if (x == NULL) {
          // some code
      };  &lt;-----
  
      // more code
  
      return 0;
  }; &lt;---
  </code></pre>
  
  <p>It is compiling with cc, not gcc. 
  What do those semicolons do? I'm assuming that there is no difference because the compiler would just consider it as empty statement.</p>