implicit declaration of strtod_l
Development toolkit for Web Services and XML data bindings for C & C++
Brought to you by:
engelen
With gcc-6.3.1 and glibc-2.24, I am getting a warning when building gsoap-2.8.42, which seems to stem from the lack of a #include <stdlib.h>/#include <cstdlib> in the stdsoap main code.
stdsoap2_ck.c: In function ‘soap_s2float’:
stdsoap2_ck.c:14146:19: warning: implicit declaration of function ‘strtod_l’ [-Wimplicit-function-declaration]
*p = (float)strtod_l(s, &r, SOAP_LOCALE(soap));
Implicit declarations are a problem because the compiler cannot do necessary type conversion (if so needed) to make the right call.
It seems to need
#define _GNU_SOURCE 1in the c file.stdsoap2.h:698
Perhaps this is the right approach for stdsoap2.h:698?
The define needs to come before any include; if that is guaranteed, seems ok.
__gnu_linux__I am not sure, since there is also__gnu_hurd__for which GNU_SOURCE is likely being needed. Is it not possible to unconditionally enable_GNU_SOURCEif WITH_C_LOCALE is true?Use 2.8.42 stable update. The
#define _GNU_SOURCEis moved up, it should be at the right place. However, we can never guarantee that users include stdsoap2.h as the first header before including anything else such as stdlib.h for example. This is really a GNU bug but fortunately most newer systems we test don't show this as an issue.This strictly concerns the building of gsoap itself, so it should be reasonably controllable by having the define "early" in stdsoap2.cpp (and not in some .h file).