Menu

#1247 error: cannot convert 'hostent**' to 'int*' for argument '5' to 'hostent* gethostbyname_r on illumos

v1.0 (example)
closed-fixed
None
5
2019-05-14
2019-04-28
No

On OpenIndiana 2018.10 (illumos-ee4417888c) gSOAP 2.8.83 compilation with GCC 6.5.0 fails with

/bin/bash ../libtool  --tag=CXX   --mode=compile /usr/gcc/6/bin/g++ -DHAVE_CONFIG_H -I. -I..       -DWITH_IPV6  -DSUN_OS -DWITH_COOKIES -m64 -O3  -MT libgsoapck___la-stdsoap2_ck_cpp.lo -MD -MP -MF .deps/libgsoapck___la-stdsoap2_ck_cpp.Tpo -c -o libgsoapck___la-stdsoap2_ck_cpp.lo `test -f 'stdsoap2_ck_cpp.cpp' || echo './'`stdsoap2_ck_cpp.cpp
libtool: compile:  /usr/gcc/6/bin/g++ -DHAVE_CONFIG_H -I. -I.. -DWITH_IPV6 -DSUN_OS -DWITH_COOKIES -m64 -O3 -MT libgsoapck___la-stdsoap2_ck_cpp.lo -MD -MP -MF .deps/libgsoapck___la-stdsoap2_ck_cpp.Tpo -c stdsoap2_ck_cpp.cpp  -fPIC -DPIC -o .libs/libgsoapck___la-stdsoap2_ck_cpp.o
stdsoap2_ck_cpp.cpp: In function 'int tcp_gethostbyname(soap*, const char*, hostent*, in_addr*)':
stdsoap2_ck_cpp.cpp:5098:85: error: cannot convert 'hostent**' to 'int*' for argument '5' to 'hostent* gethostbyname_r(const char*, hostent*, char*, int, int*)'
   while ((r = gethostbyname_r(addr, hostent, tmpbuf, tmplen, &hostent, &soap->errnum)) < 0)
                                                                                     ^

Our GETHOSTBYNAME(3NSL) says:

struct hostent gethostbyname_r(const char name,
struct hostent result, char buffer, int buflen,
int *h_errnop);

Simmilar ticket: https://sourceforge.net/p/gsoap2/bugs/1246/.

Discussion

  • Robert van Engelen

    Unfortunately, this is a very difficult issue to fix because we did not yet find a reliable way to detect which of the two or three versions of gethostbyname_r is supported by a platform, and sources like stackoverflow are not helpful (yet). We tried three different approaches. For each we pissed off someone by failing their builds. Please see the notes https://sourceforge.net/p/gsoap2/bugs/1246/ and modify the #ifdef test to see what works for you. Perhaps you can include in your post the full list of macros defined on your platform and compiler to see which ones affect the test positively and negatively. See also https://sourceforge.net/p/gsoap2/bugs/1238/

     
  • Robert van Engelen

    • status: open --> pending-fixed
    • assigned_to: Robert van Engelen
     
  • Robert van Engelen

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB