If I use exit(), GCC doesn’t give a warning:
int main()
{
exit(EXIT_SUCCESS);
}
If we use any other function, we will definitely meet such a warning:
warning: control reaches end of non-void function
How does exit() make the parent function get its return value without using return(), which the compiler makes?
On GNU libc,
exitis declared with__attribute__((__noreturn__)), which tells gcc that the function does not return.