Reputation: 1683
This is my warning.
implicit declaration of function 'exit'
How i can remove it.
i am using linux & gcc compiler.
Upvotes: 62
Views: 104010
Reputation: 107
exit() is a library function, the respecive prototypes are present in the stdlib.h header file, inoder to call the process to specified code for exit function, you need to attach the as #include stdlib.h header in your program. that is the reason we should add the stdlib.h header. eventhough you can run the program, but it shows the warning message like below:
warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
but, this kind of program not recommended, we need to take care of what we are given in the program,be cautious. warning may leads runtime error.
Upvotes: 2
Reputation: 5154
Do you have this preprocessor? If not, add it.
#include <stdlib.h>
Upvotes: 12