Hacker News new | ask | show | jobs
by las_cases 4195 days ago
Thank you for pointing this out! It is even described in the language's specification:

"If the return type of the main function is a type compatible with int, a return from the initial call to the main function is equivalent to calling the exit function with the value returned by the main function as its argument; 11) reaching the } that terminates the main function returns a value of 0." ( http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf, 5.1.2.2.3 Program termination )