Public bug reported:

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

** Affects: c-ares (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to c-ares in Ubuntu.
https://bugs.launchpad.net/bugs/1749729

Title:
  ares_library_init_mem missing from ares.h

Status in c-ares package in Ubuntu:
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/c-ares/+bug/1749729/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to