cURL / Mailing Lists / curl-library / Single Mail


Re: [bagder/curl] 78c25c: lib: Only define curl_dofreeaddrinfo if struct add...

From: Dan Fandrich <>
Date: Sat, 28 Nov 2015 00:28:34 +0100

On Fri, Nov 27, 2015 at 11:12:55PM +0100, Daniel Stenberg wrote:
> On Fri, 27 Nov 2015, GitHub wrote:
> > Author: Dan Fandrich <>
> > lib: Only define curl_dofreeaddrinfo if struct addrinfo is available
> Dan, what's the exact reason for this?
> The HAVE_GETADDRINFO is defined for when the libc function is detected and
> meant to be used. This commit makes c-ares build warnings/errors and I can
> fix that by removing the #undef HAVE_GETADDRINFO from the c-ares condition
> in lib/curl_setup.h but before I just go ahead and do that I wanted to
> understand your change better.

I found a combination of flags that caused 'struct addrinfo' to be disabled
for glibc, causing compilation failure of the prototype for curl_dogetaddrinfo.
I made the assumption that curl_dogetaddrinfo wouldn't be needed unless
curl_dogetaddrinfo or Curl_getaddrinfo_ex was available so commented it out
otherwise. Does c-ares *need* curl_dofreeaddrinfo, or is it failing elsewhere?
Maybe the c-ares section of curl_setup.h needs an #undef HAVE_FREEADDRINFO
added alongside the #undef HAVE_GETADDRINFO.

>>> Dan
List admin:
Received on 2015-11-28