-
August 29th, 2003, 08:28 PM
#1
Another gcc compiler warning
Hi All,
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);
}
.......
.......
}
Ahsan
-
August 29th, 2003, 08:58 PM
#2
Got the problem.
I didn't include the header files for bzero() and inet_addr()
Ahsan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|