title: Why no compiler error for main() without a return at the end?
body: <p>I'm working on a C-brain teaser:  Write the standard Hello-World program, without semi-colons.</p>
  
  <p>My best answer so far is:</p>
  
  <pre><code>int main(void)
  {
      if (printf("Hello World!\n"), exit(0), 0)
      {
          /* do nothing */
      }
  }
  </code></pre>
  
  <p>But I don't understand why I don't get compiler error (Visual Studio):</p>
  
  <pre><code>error C4716: 'main' : must return a value
  </code></pre>
  
  <p>I've tried other functions with a return-type declared, but missing a return-statement, and get this compiler error.</p>
  
  <hr>
  
  <p>Note that I've also tried:</p>
  
  <pre><code>int foo(void)
  {
      if (printf("Hello World!\n"), exit(0), true)
      {
          /* do nothing */
      }
  }
  
  int main(void)
  {
      foo();
  }
  </code></pre>
  
  <p>And don't get a compiler error on foo.  If I remove the "exit(0)", I <em>do</em> get the compiler error.  Apparently the compiler has knowledge that "exit" is a special function?  This seems very odd to me.</p>