Re:F() vs. F(void) in C vs. C++
by Vogtinator on Monday May 13, 2019 @02:54AM
(#19896859)
That's a special case though and unrelated to ().
Like it's also explicitly allowed to omit a return statement in main altogether, which implies a return 0.
[ Parent
| on HN ]
That was added in C99; previously, "falling off" the end of main without a return statement resulted in an indeterminate termination status. Countless sloppily written C programs had garbage termination statuses because of this, making it impossible for higher level programs (e.g. scripts) to reliably test for successful execution.