No. The exit
function never returns, but instead terminates the process from which it called. The C compiler has no intuitive understanding and treats it like any other void
return function.
This means that although exit
will end your function, the C compiler will not see this. Therefore, it will still have the correct return, otherwise it will spit out warnings / errors (there will be a rather high level of errors). But thatβs enough to get around
int myFunc() { ... exit(exitCode); return 42;
source share