Brad Walker | 22 Apr 07:56

[s48-1.8]: glibc 2.8/gcc4.3.0 build problem

Hello,

I'm packaging scheme48 for Fedora 9 and I ran into build trouble. The
build process throws this error:

c/unix/socket.c: In function 'gethostbyname_thread':
c/unix/socket.c:354: error: 'struct hostent' has no member named
'h_addr'
c/unix/socket.c: In function 's48_get_host_by_name':
c/unix/socket.c:377: warning: implicit declaration of function
'pthread_create'
c/unix/socket.c:385: error: 'struct hostent' has no member named
'h_addr'

I found this definition of hostent in /usr/include/netdb.h (from package
glibc-headers-2.8-1.x86_64):

/* Description of data base entry for a single host.  */
struct hostent
{
  char *h_name;			/* Official name of host.  */
  char **h_aliases;		/* Alias list.  */
  int h_addrtype;		/* Host address type.  */
  int h_length;			/* Length of address.  */
  char **h_addr_list;		/* List of addresses from name server.  */
#if defined __USE_MISC || defined __USE_GNU
# define	h_addr	h_addr_list[0] /* Address, for backward compatibility.*/
#endif
};

(Continue reading)

Brian D. Carlstrom | 22 Apr 15:42

Re: [s48-1.8]: glibc 2.8/gcc4.3.0 build problem

h_addr seems to be deprecated. this is probably to try and encourage
callers to consider the fact that there can be more than one entry in
h_addr_list. I've heard about this elsewhere, perhaps on one of the
fedora lists. it could also just be for stricter standards compliance
for hostent.

Probably the simplest solution is just to use
h_addr_list[0] directly but if the code is passing the values back to
the Scheme world, its probably worth switching that to return
h_addr_list instead.

seems like a pthread.h include is needed as well.

-bri

At Tue, 22 Apr 2008 07:57:53 +0200,
Brad Walker wrote:
> 
> Hello,
> 
> I'm packaging scheme48 for Fedora 9 and I ran into build trouble. The
> build process throws this error:
> 
> c/unix/socket.c: In function 'gethostbyname_thread':
> c/unix/socket.c:354: error: 'struct hostent' has no member named
> 'h_addr'
> c/unix/socket.c: In function 's48_get_host_by_name':
> c/unix/socket.c:377: warning: implicit declaration of function
> 'pthread_create'
> c/unix/socket.c:385: error: 'struct hostent' has no member named
(Continue reading)

Ivan Shmakov | 22 Apr 18:29

Re: [s48-1.8]: glibc 2.8/gcc4.3.0 build problem

>>>>> Brad Walker <me <at> bradmwalker.com> writes:

[...]

 > /* Description of data base entry for a single host.  */
 > struct hostent
 > {
 >   char *h_name;			/* Official name of host.  */
 >   char **h_aliases;		/* Alias list.  */
 >   int h_addrtype;		/* Host address type.  */
 >   int h_length;			/* Length of address.  */
 >   char **h_addr_list;		/* List of addresses from name server.  */
 > #if defined __USE_MISC || defined __USE_GNU
 > # define	h_addr	h_addr_list[0] /* Address, for backward compatibility.*/
 > #endif
 > };

 > I tried passing CFLAGS "-D__USE_GNU" and "-D__USE_MISC" to
 > ./configure in CFLAGS but the errors still persist. The system has
 > GCC 4.3.0 and glibc 2.8.

	Could you please try passing `CPPFLAGS=-D_GNU_SOURCE' instead?

Michael Sperber | 23 Apr 08:28

Re: [s48-1.8]: glibc 2.8/gcc4.3.0 build problem


Brad Walker <me <at> bradmwalker.com> writes:

> Hello,
>
> I'm packaging scheme48 for Fedora 9 and I ran into build trouble. The
> build process throws this error:
>
> c/unix/socket.c: In function 'gethostbyname_thread':
> c/unix/socket.c:354: error: 'struct hostent' has no member named
> 'h_addr'
> c/unix/socket.c: In function 's48_get_host_by_name':
> c/unix/socket.c:377: warning: implicit declaration of function
> 'pthread_create'
> c/unix/socket.c:385: error: 'struct hostent' has no member named
> 'h_addr'

The people who posted follow-ups are essentially on target (thanks!):
Just replace by h_addr_list[0].  In future versions, we won't be using
this part of the sockets API anymore, so the problem should go away by
itself then.

--

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla


Gmane