Version of my gcc:2.96
First of all i complied the file with the command gcc
file.c.I got an a.out file which worked properly.The
output is we got here properly.
So the compiler is pretty intelligent .
Now if you compile with gcc -Wall file.c it gives an
error called implicit declaration of function 'exit'
.That is true refer to your system manual or man page
.It shows that void exit(int status) function which we
are using in the program needs a header file called
stdlib.h to be included.
If we include that header file by #include <stdlib.h>
in the program and compile with gcc -Wall file.c
we don't get the error but we get the required output.
To get uninitialized variables we need to compile it
with the command gcc -Wall -O file.c or gcc
-Wuninitialized -O file.c.For me it gives an error
saying warning:'x' might be uninitialized.
I think it clarifies the doubt.
Before including functions it is a good thing to check
whether the header files are included because for me
while coding ,although my program(C code) was correct
since i didn't compile it properly with library
extension like -lm for math.h or didn't include some
header files it gave me an error.
Hope that solves your doubt.
-----*-------------------------------------------*-----
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/