On 02/25/2010 07:30 AM, Steve Teale wrote: > There's a fair chunk of code in GCC that builds tables of information > about built-in functions. > > I assume that these are there for good reason, and my guess was that > they would obviate the need for many common header files, which in fact > they seem to do. But if I have a tiny program like: > > int main() > { > float f; > f = cos(1.0); > printf("%f\n", f); > return 0; > } > > compilation produces warnings: > > steve@Ubuntu:~/scratch$ gcc nohead.c > nohead.c: In function ‘main’: > nohead.c:4: warning: incompatible implicit declaration of built-in > function ‘cos’ > nohead.c:5: warning: incompatible implicit declaration of built-in > function ‘printf’ > steve@Ubuntu:~/scratch$ ./a.out > 0.540302 > > The program runs. Why is gcc warning me about its own internals? Also, > incompatible with what? Without a declaration, C assumes that a function is implicitly int f(), which is wrong for cos(). This is true even though cos() is built-in to gcc. You need the header files. Andrew.