T
thibault.langlois
Hello,
I get a warning when I compile:
#include <string.h>
int main (int argc, char ** argv)
{
char * s;
s = strdup("a string");
return 0;
}
with gcc (GCC) 3.3.5 (Debian 1:3.3.5-8ubuntu2) :
$ gcc -Wall -ansi warning.c
warning.c: In function `main':
warning.c:7: warning: implicit declaration of function `strdup'
warning.c:7: warning: assignment makes pointer from integer without a
cast
Does anybody knows how can I supress this warning ?
if I put a cast : s = (char *) strdup("a string");
I get another warning message:
warning.c:7: warning: implicit declaration of function `strdup'
I do not understand why this happens because strdup is declared in
string.h
Thanks,
Thibault Langlois
I get a warning when I compile:
#include <string.h>
int main (int argc, char ** argv)
{
char * s;
s = strdup("a string");
return 0;
}
with gcc (GCC) 3.3.5 (Debian 1:3.3.5-8ubuntu2) :
$ gcc -Wall -ansi warning.c
warning.c: In function `main':
warning.c:7: warning: implicit declaration of function `strdup'
warning.c:7: warning: assignment makes pointer from integer without a
cast
Does anybody knows how can I supress this warning ?
if I put a cast : s = (char *) strdup("a string");
I get another warning message:
warning.c:7: warning: implicit declaration of function `strdup'
I do not understand why this happens because strdup is declared in
string.h
Thanks,
Thibault Langlois