ares_library_init_mem missing from ares.h

Bug #1749729 reported by Tom Lloyd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
c-ares (Ubuntu)
New
Undecided
Unassigned

Bug Description

In summary:

Looks like the manual page for c-ares is unclear as to the
availability of the two functions it covers:
ares_library_init
ares_library_init_mem

Secondly the #define only seems to cover availability of:
ares_library_init

I would suggest an update to the manual with the addition of
2. Another page/section for ares_library_init_mem another define
for the ares_library_init_mem function which I am guess came in after 1.10.

----------------------------------------
I am making calls to:

ares_library_init_mem

I am expecting it to compile

However I am getting:

undefined reference to `ares_library_init_mem'

This code is further protected with:
#ifdef CARES_HAVE_ARES_LIBRARY_INIT

see manual page text:
AVAILABILITY
This function was first introduced in c-ares version 1.7.0 along with the definition of preprocessor symbol CARES_HAVE_ARES_LIBRARY_INIT as an indication of the availability of this function. Its recursive behavior, which requires a matching number of calls to ares_library_cleanup() in order to deinitialize the library, is present since c-ares version 1.10.0. Earlier versions would deinitialize the library on the first call to ares_library_cleanup().

Since the introduction of this function it is absolutely mandatory to call it for any Win32/64 program using c-ares.

Non-Win32/64 systems can still use c-ares version 1.7.0 without calling ares_library_init due to the fact that currently it is nearly a do-nothing function on non-Win32/64 platforms at this point.

Found inside ares_versions.h:

#define ARES_VERSION_MAJOR 1
#define ARES_VERSION_MINOR 10
#define ARES_VERSION_PATCH 0
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
                       (ARES_VERSION_MINOR<<8)|\
                       (ARES_VERSION_PATCH))
#define ARES_VERSION_STR "1.10.0"

#if (ARES_VERSION >= 0x010700)
# define CARES_HAVE_ARES_LIBRARY_INIT 1
# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
#else
# undef CARES_HAVE_ARES_LIBRARY_INIT
# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
#endif
------------------------------------------
System Info:
lsb_release -rd
Description: Ubuntu 16.04.3 LTS
Release: 16.04

libc-ares-dev:
  Installed: 1.10.0-3ubuntu0.2
  Candidate: 1.10.0-3ubuntu0.2
  Version table:
 *** 1.10.0-3ubuntu0.2 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.10.0-3 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Tags: xenial
tags: added: xenial
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.