warning: incompatible implicit declaration of built-in function ‘xyz’

Posted by Alex Reynolds on Stack Overflow See other posts from Stack Overflow or by Alex Reynolds
Published on 2009-06-10T18:01:49Z Indexed on 2010/06/09 14:32 UTC
Read the original article Hit count: 507

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about c

    Related posts about gcc