CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Posts
    71

    Unhappy 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

  2. #2
    Join Date
    Mar 2003
    Posts
    71
    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
  •  





Click Here to Expand Forum to Full Width

Featured