
Hi All, If I include boost/regex.hpp - the builtin c signbit stops being available. I am using my version of gcc 4.5.0 and my version of boost (built and installed with defaults) I've removed distro's install of boost and gcc. I am new to this list so apologies if I've missed any need information. TIA Adrian ---------------------------------------------------------------------- adrianc@dluadrianc:~> cat signbit.cc #include <iostream> #include <math.h> #include <boost/version.hpp> #ifdef WITH_BOOST_REGEX_ADRIAN #include <boost/regex.hpp> #endif int main(int argc, char *argv[]) { float a=12.4234; float b=-123.4333; #ifdef _XOPEN_SOURCE std::cout << "_XOPEN_SOURCE=" << _XOPEN_SOURCE << std::endl; #endif #ifdef _ISOC99_SOURCE std::cout << "_ISOC99_SOURCE is here\n"; #endif std::cout << "Boost version=" << BOOST_LIB_VERSION << std::endl; std::cout << "Boost version=" << BOOST_VERSION << std::endl; #ifdef WITH_SIGNBIT_ADRIAN std::cout << "signbit a=" << signbit(a) << std::endl; std::cout << "signbit b=" << signbit(b) << std::endl; #endif return 0; } adrianc@dluadrianc:~> g++ -DWITH_SIGNBIT_ADRIAN signbit.cc adrianc@dluadrianc:~> a.out _XOPEN_SOURCE=700 _ISOC99_SOURCE is here Boost version=1_43 Boost version=104300 signbit a=0 signbit b=-2147483648 adrianc@dluadrianc:~> g++ -DWITH_SIGNBIT_ADRIAN -DWITH_BOOST_REGEX_ADRIAN signbit.cc signbit.cc: In function 'int main(int, char**)': signbit.cc:25:42: error: 'signbit' was not declared in this scope adrianc@dluadrianc:~> :~> which gcc /usr/local/bin/gcc :~> gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapp er Target: i686-pc-linux-gnu Configured with: ../gcc-4.5.0/configure --enable-__cxa_atexit --enable-languages=c,c++ --enable-threads --with-cpu=core2 --disable-nls --with-arch=i686 --with-mpfr=/usr/local --with-gmp=/usr/local --with-mpc=/usr/local --with-build-time-tools=/usr/local --enable-lto Thread model: posix gcc version 4.5.0 (GCC)

If I include boost/regex.hpp - the builtin c signbit stops being available. I am using my version of gcc 4.5.0 and my version of boost (built and installed with defaults)
Confirmed: and that's seriously annoying, but not our fault, as just: #include <math.h> #include <cmath> is enough to break ::signbit. This is what's happening in our code BTW - regex includes Boost.Hash which include <cmath> which breaks your code. Sorry, but there's no easy solution to this, other than to use std::signbit from <cmath> I guess. John.

Thanks John I've create bug for gcc team http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44611 Adrian -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of John Maddock Sent: Saturday, June 19, 2010 10:15 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Boost regex is breaking math.h's signbit
If I include boost/regex.hpp - the builtin c signbit stops being available. I am using my version of gcc 4.5.0 and my version of boost (built and installed with defaults)
Confirmed: and that's seriously annoying, but not our fault, as just: #include <math.h> #include <cmath> is enough to break ::signbit. This is what's happening in our code BTW - regex includes Boost.Hash which include <cmath> which breaks your code. Sorry, but there's no easy solution to this, other than to use std::signbit from <cmath> I guess. John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Adrian
-
boost@bluedreamer.com
-
John Maddock