Opened 14 years ago
Closed 13 years ago
#2947 closed Bugs (fixed)
serialization/throw_exception.hpp uses BOOST_NO_EXCEPTIONS in the wrong way
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Boost 1.39.0 | Component: | serialization |
Version: | Boost 1.37.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using boost multi_index in a project that doesn't supply -fexceptions (or rather that supplies -fno-exceptions) to the compiler fails at linking time because there's an undefined reference to boost::throw_exception(std::exception). This appears to be caused by the #ifdef stuff in serialization/throw_exception.hpp, which uses std::exception if BOOST_NO_EXCEPTIONS is defined. However this define is set when exception support is turned off.
Hence instead of "#ifdef BOOST_NO_EXCEPTIONS" this should probably be "#ifndef BOOST_NO_EXCEPTIONS". Changing the header file accordingly makes the project I have here link properly.
First version that breaks is 1.37, in 1.36 the problem doesn't appear.
Change History (3)
comment:1 by , 14 years ago
comment:2 by , 13 years ago
Component: | None → serialization |
---|---|
Owner: | set to |
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have merged the fix to release branch. It will be available in 1.40.0. It might be available in 1.39.1, if we do it. Andreas, this fixes the duplicate boost::serialization::throw_exception. You still will have to define boost::throw exception with appropriate behaviour.
The actual problem is that: