librelist archives

« back to archive

patch to prevent a warning when compiling conkeror-spawn-helper.c

patch to prevent a warning when compiling conkeror-spawn-helper.c

From:
Joseph Mingrone
Date:
2013-11-04 @ 02:56
This patch just includes the line

#include <arpa/inet.h>

in conkeror-spawn-helper.c.

Joseph

Re: [conkeror] patch to prevent a warning when compiling conkeror-spawn-helper.c

From:
John J. Foerch
Date:
2013-11-04 @ 03:13
On Sun, Nov 03, 2013 at 10:56:23PM -0400, Joseph Mingrone wrote:
> This patch just includes the line
> 
> #include <arpa/inet.h>
> 
> in conkeror-spawn-helper.c.
> 
> Joseph
> 

Can you provide more detail on the nature of the problem?

Thanks,

-- 
John Foerch

Re: patch to prevent a warning when compiling conkeror-spawn-helper.c

From:
Joseph Mingrone
Date:
2013-11-04 @ 05:08
"John J. Foerch" <jjfoerch@earthlink.net> writes:

> On Sun, Nov 03, 2013 at 10:56:23PM -0400, Joseph Mingrone wrote:
>> This patch just includes the line
>> 
>> #include <arpa/inet.h>
>> 
>> in conkeror-spawn-helper.c.
>> 
>> Joseph
>> 
>
> Can you provide more detail on the nature of the problem?

Compiling with the default warning level with clang, gave the warning below.

conkeror-spawn-helper.c:123:24: warning: implicit declaration of
function 'inet_addr' is invalid in C99
[-Wimplicit-function-declaration]

The inet(3) man pages on both GNU/Linux and FreeBSD says #include
<arpa/inet.h> is required.  When I added the line, the warning went away.

Joseph

-------------------------------------------------------------------------------

INET(3)                    Linux Programmer’s Manual                   INET(3)

NAME 

inet_aton, inet_addr, inet_network, inet_ntoa, inet_makeaddr,
       inet_lnaof, inet_netof - Internet address manipulation routines

SYNOPSIS
       #include <sys/socket.h>
       #include <netinet/in.h>
       #include <arpa/inet.h>
...

-------------------------------------------------------------------------------

INET(3)            FreeBSD Library Functions Manual            INET(3)

NAME
     inet_aton, inet_addr, inet_network, inet_ntoa, inet_ntoa_r, inet_ntop,
     inet_pton, inet_makeaddr, inet_lnaof, inet_netof — Internet address
     manipulation routines

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <sys/types.h>
     #include <sys/socket.h>
     #include <netinet/in.h>
     #include <arpa/inet.h>
...
-------------------------------------------------------------------------------