I am having strange warnings from gcc compiler, which I don't think should come while cmpiling.
Can anyone help? The warnings are:
- warning: implicit declaration of function 'bzero'
- warning: implicit declaration of function 'inet_addr'
The code is as below:
int main(int argc, char **argv)
{
struct sockaddr_in servaddr;
char buffer[BUFLEN];
int n;
argv0 = argv[0];
if ( (sockfd=Socket(AF_INET,SOCK_STREAM,0)) < 0 )
exit(1);
bzero(&servaddr,sizeof(servaddr));
servaddr.sin_family = AF_INET;
if ( (servaddr.sin_addr.s_addr = inet_addr("131.170.24.42"))
== -1 ) {
fprintf(stderr,"%s : inet_addr failed, errno=%d\n",argv0,errno);
exit(1);
}
.......
.......
}More Information:
- c:90: warning: incompatible implicit declaration of built-in function 'strncpy' gplot
- h:75: warning: implicit declaration of function 'ppm_writeppm' ppm_util
- From: Dan Kegel <dkegel at ixiacom dot com>; To: Bryce Schober <bryceman at dpzone dot com>; Cc: crossgcc at sources dot redhat dot com; Date: Thu, 02 Oct 2003 10:24:33 -0700; Subject: Re: OT: gcc warning: implicit declaration of function
- c:77: warning: implicit declaration of function `freeaddrinfo' You're probably not including the reqired headers
- If you later provide a declaration for the function which returns a type
More:


LinkBack URL
About LinkBacks
Reply With Quote

























































Bookmarks