J
John Buckley
Hello!
I have a program like this:
#include <stdlib.h>
int main(void)
{
/* do stuff */
myExitFunc(0); /* very last statement in main() */
}
void myExitFunc(int ret)
{
exit(ret);
}
When I compile this, I get "warning: control reaches end of non-void
function" because there is no return statement in main. Question is, can I
safely ignore this warning or should I stick in a return anyway to pacify
the compiler?
Thanks
JB
I have a program like this:
#include <stdlib.h>
int main(void)
{
/* do stuff */
myExitFunc(0); /* very last statement in main() */
}
void myExitFunc(int ret)
{
exit(ret);
}
When I compile this, I get "warning: control reaches end of non-void
function" because there is no return statement in main. Question is, can I
safely ignore this warning or should I stick in a return anyway to pacify
the compiler?
Thanks
JB