(3.6.1/5) A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and
calling exit with the return value as the argument. If control reaches
the end of main without encountering a return statement,the effect is
that of executing return 0;
我可以在C99中执行以下操作而不返回0吗?
int main() { }
解决方法
5.1.2.2.3 Program termination
If the return type of the
main
function is a type compatible with int,a return from the initial call to themain
function is equivalent to calling theexit
function with the value returned by themain
function as its argument;11) reaching the}
that terminates themain
function returns a value of 0. If the return type is not compatible withint
,the termination status returned to the host environment is unspecified.