warning: incompatible implicit declaration of built-in function ‘xyz’
- by Alex Reynolds
I'm getting a number of these warnings when compiling a few binaries:
warning: incompatible implicit declaration of built-in function ‘strcpy’
warning: incompatible implicit declaration of built-in function ‘strlen’
warning: incompatible implicit declaration of built-in function ‘exit’
To try to resolve this, I have added
#include <stdlib.h>
at the top of the C files associated with this warning, in addition to compiling with the following flags:
CFLAGS = -fno-builtin-exit -fno-builtin-strcat -fno-builtin-strncat -fno-builtin-strcpy -fno-builtin-strlen -fno-builtin-calloc
I am using GCC 4.1.2:
$ gcc --version
gcc (GCC) 4.1.2 20080704
What should I do to resolve these warnings? Thanks for your advice.