title: Program should not work as per `C faq` but it works
body: <p>I was just going through the <code>c-faq</code>, when I came across <a href="http://c-faq.com/struct/retcrash.html" rel="nofollow">this</a> page. I stated that the following program will have a core dump:</p>
  
  <pre><code>struct list {
      char *item;
      struct list *next;
  }
  
  /* Here is the main program. */
  
  main(argc, argv)
  {}
  </code></pre>
  
  <p>The reason they told for the core dump to happen was:</p>
  
  <blockquote>
    <p>A missing semicolon at the end of the structure declaration causes main to be declared as returning a structure. (The connection is hard to see because of the intervening comment.) Since structure-valued functions are usually implemented by adding a hidden return pointer (see question 2.9), the generated code for main() tries to accept three arguments, although only two are passed (in this case, by the C start-up code). See also questions 10.9 and 16.4.</p>
  </blockquote>
  
  <p>Although, when I ran this program online over <a href="http://www.tutorialspoint.com/compile_c_online.php" rel="nofollow">here</a>, it worked perfectly and the program did run till the end. Also, when I compiled this program using gcc, I got no warnings.</p>
  
  <p>I was surprised, as the program should have not runned till the end. Can someone tell me why this program works? If it is correct, why is it mentioned that the program will not work (any chance it might crash?).</p>
  
  <p><strong>NOTE:</strong> Please do not post comments such as use <code>int main</code> because I have just copy pasted the code, and in actual, I use the proper way.</p>