J
John
What headers does GCC include by default and is there any way to
change the behavior?
It seems on my system that math.h is being included by default and I
don't need to include it in source for
math functions. The code below compiles just fine as long as I
include the math library -lm.
I don't even include stdio.h and it works just fine. I'm not sure I
like this.
gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)
gcc -lm mathtest.c
main()
{
printf("exp(3.3) %f \n", exp(3.3));
printf("2^5 %f \n", pow(2,5));
}
change the behavior?
It seems on my system that math.h is being included by default and I
don't need to include it in source for
math functions. The code below compiles just fine as long as I
include the math library -lm.
I don't even include stdio.h and it works just fine. I'm not sure I
like this.
gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)
gcc -lm mathtest.c
main()
{
printf("exp(3.3) %f \n", exp(3.3));
printf("2^5 %f \n", pow(2,5));
}