Closed avysotsk closed 8 years ago
I see the same issue in file groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp. Namespace is not explicitly set for function modf on line 476. This results to the similar compilation error. The propose fix is similar:
$ git diff groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp diff --git a/groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp b/groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp index d6a1948..7ffc9de 100644 --- a/groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp +++ b/groups/bdl/bdldfp/bdldfp_decimalconvertutil.cpp @@ -473,7 +473,7 @@ Decimal64 DecimalConvertUtil::decimal64FromDouble(double binary) // to its integer part. If it's small enough (using 1e-17, generously // below the 1e-16 computed above), skip the verification. double dn, r; - r = modf(d, &dn); + r = bsl::modf(d, &dn); if ((dn != 0 && r / dn < 1e-17) || r == 0) { return rv; // RETURN }
When someone uses GNU compilers, then the issue is not seen. That's happened because GNU compiler includes by default system headers like /usr/include/stdlib.h or /usr/include/math.h or /usr/include/string.h. And in these headers one can find explicit point to the std:: namespace. For example,
/* * Allow global visibility for symbols defined in * C++ "std" namespace in. */ #if __cplusplus >= 199711L .......................................... using std::strlen;
So, it means when in BSL code one writes just "strlen" or "modf", then functions will be taken from std:: namespace. But not from bsl:: namespace. It'll mask the problem.
We still use the libCstd for our production Sun Studio builds (unfortunately). How are you building bde (i.e., the waf
commands?). We do have an stlport
build configuration, though it doesn't fix this issue.
This was straight forward to reproduce. Will have a fix this week
I don't see the issue in bdldfp, but will make the change suggested.
Found a related error with our stlport build flags. @che2 was going to push a change to the bde-tools repository for that.
This should be fixed by commit: 370cab27aba489f7910aa82a7c16c7abcea037f1
I'm trying to build BSL on Solaris with Oracle Solaris Studio compilers. I stopped in the build step with the error: $ CC -library=stlport4 -DBDE_BUILD_TARGET_STLPORT -template=no%extdef -xcode=pic32 -m64 -xtarget=generic -DBDE_BUILD_TARGET_EXC -DBDE_BUILD_TARGET_MT -DBDE_BUILD_TARGET_OPT -m64 -xtarget=generic -xthreadvar=dynamic -xannotate=no -features=except -xO3 -DNDEBUG -xbuiltin=%all -D_POSIX_PTHREAD_SEMANTICS -mt -DBSLS_IDENT_OFF -library=no%rwtools7 -xcode=pic32 -DPIC -I/BSL/gcc/new/bde/groups/bdl/bdlb -I/BSL/gcc/new/bde/groups/bdl/bdlf -I/BSL/gcc/new/bde/groups/bdl/bdlscm -I/BSL/gcc/new/bde/groups/bsl/bsls -I/BSL/gcc/new/bde/groups/bsl/bslscm -I/BSL/gcc/new/bde/groups/bsl/bsldoc -I/BSL/gcc/new/bde/groups/bsl/bslmf -I/BSL/gcc/new/bde/groups/bsl/bslma -I/BSL/gcc/new/bde/groups/bsl/bslalg -I/BSL/gcc/new/bde/groups/bsl/bslh -I/BSL/gcc/new/bde/groups/bsl/bsltf -I/BSL/gcc/new/bde/groups/bsl/bslstl -I/BSL/gcc/new/bde/groups/bsl/bsl+bslhdrs -I/BSL/gcc/new/bde/groups/bsl/bsl+stdhdrs -I/BSL/gcc/new/bde/groups/bsl/bslim -I/BSL/gcc/new/bde/groups/bsl/bslmt -I/BSL/gcc/new/bde/groups/bsl/bslx -I/BSL/gcc/new/bde/build/thirdparty/decnumber -I/BSL/gcc/new/bde/thirdparty/decnumber -I/BSL/gcc/new/bde/build/thirdparty/inteldfp/LIBRARY/src -I/BSL/gcc/new/bde/thirdparty/inteldfp/LIBRARY/src groups/bdl/bdlb/bdlb_cstringhash.cpp -c -o /BSL/gcc/new/bde/build/groups/bdl/bdlb/bdlb_cstringhash.cpp.1.o CC: Warning: illegal use of -library option, illegal item ignored: rwtools7 CC: Warning: illegal use of -library option, empty value ignored "/BSL/gcc/new/bde/groups/bdl/bdlb/bdlb_cstringhash.h", line 261: Error: The function "strlen" must have a prototype. 1 Error(s) detected.
I would propose the following fix: