tags:

views:

558

answers:

2

This is my warning.

implicit declaration of function 'exit'

How i can remove it.

i am using linux & gcc compiler.

+9  A: 

Add:

#include <stdlib.h>

to the top of your program.

Greg Hewgill
@Greg Hewgill: In my program, I have not used `#include <stdlib.h>` and I am getting this warning only when I use `-Wall` option. Otherwise the program compiles fine and executable runs properly. This means that gcc is somehow able to link to the file without my including it. How is that happening?
Lazer
@eSKay: Implicit declarations are *permitted* in C unless you use the `-Wmissing-protypes` warning switch (which is turned on by `-Wall`).
Greg Hewgill
+1  A: 

Do you have this preprocessor? If not, add it.

#include <stdlib.h>
shinkou