If the main function executes a return that specifies no value, the termination status returned to the host environment is undefined.
If the return type of the
mainfunction is a type compatible with
int, a return from the initial call to the
mainfunction is equivalent to calling the
exitfunction with the value returned by the
mainfunction as its argument; reaching the
}that terminates the
mainfunction returns a value of 0. If the return type is not compatible with
int, the termination status returned to the host environment is unspecified.
A return statement in
mainhas the effect of leaving the main function (destroying any objects with automatic storage duration) and calling
exitwith the return value as the argument. If control reaches the end of
mainwithout encountering a
returnstatement, the effect is that of executingreturn 0;
*1:gccはこの言語仕様に "厳格に" 従うらしい。c - GCC default main return value is not zero - Stack Overflow参照