bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replacement getaddrinfo not working properly


From: Matthew Woehlke
Subject: Re: replacement getaddrinfo not working properly
Date: Thu, 05 Apr 2007 09:04:20 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0

Andrew J. Schorr wrote:
It seems that adding AC_USE_SYSTEM_EXTENSIONS to configure.ac
will always cause _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE to
be defined (at least that is the case for autoconf version 2.61 on my
linux FC6 host).  From /usr/share/autoconf/autoconf/specific.m4:
[snip]
As you can see, this defines _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE
unconditionally.

As a result, this logic in io.c to decide whether to include
missing_d/getaddrinfo.h is not working as intended:

   #ifdef _TANDEM_SOURCE
   #include <arpa/inet.h>
   #include <netdb.h>
   #else
   #ifdef HAVE_GETADDRINFO
   #include <netdb.h>
   #else
   #include "missing_d/getaddrinfo.h"
   #endif
   #endif

Because _TANDEM_SOURCE is defined, there is never any chance
of including missing_d/getaddrinfo.h.

This causes compilation errors on systems that do not supply getaddrinfo.

I'm not certain of the best fix.  Why is it necessary to test
for _TANDEM_SOURCE at all in this spot?  It seems that the only
difference is whether to include <arpa/inet.h>.  Couldn't configure.ac
just test whether this header file exists (and similarly for netdb.h),
and just include them unconditionally if they exist (without caring
about _TANDEM_SOURCE)?

What platform are you on? _TANDEM_SOURCE is needed for NSK targets (at least, for the box I have), but I doubt it should be defined for other targets. __TANDEM is defined by the compiler by default and could be used to check if the target needs _TANDEM_SOURCE. Or it could key off the target triple, in this case '*-tandem-*'.

--
Matthew
<insert bad pun... on second thought, better not>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]