diff --git a/boost/boost/archive/impl/basic_binary_iprimitive.ipp b/boost/boost/archive/impl/basic_binary_iprimitive.ipp index 5d48a71..c9ee750 100644 --- a/boost/boost/archive/impl/basic_binary_iprimitive.ipp +++ b/boost/boost/archive/impl/basic_binary_iprimitive.ipp @@ -182,7 +182,7 @@ template BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_binary_iprimitive::~basic_binary_iprimitive(){ // push back unread characters - int result = static_cast &>( + (void) static_cast &>( m_sb ).sync(); //destructor can't throw ! diff --git a/boost/boost/archive/iterators/base64_from_binary.hpp b/boost/boost/archive/iterators/base64_from_binary.hpp index c8f2315..fbabdf6 100644 --- a/boost/boost/archive/iterators/base64_from_binary.hpp +++ b/boost/boost/archive/iterators/base64_from_binary.hpp @@ -43,7 +43,7 @@ struct from_6_bit { "0123456789" "+/"; assert(t < 64); - return lookup_table[t]; + return lookup_table[static_cast(t)]; } }; diff --git a/boost/boost/statechart/state_machine.hpp b/boost/boost/statechart/state_machine.hpp index 88b38aa..9c99cd1 100644 --- a/boost/boost/statechart/state_machine.hpp +++ b/boost/boost/statechart/state_machine.hpp @@ -549,9 +549,9 @@ class state_machine : noncopyable add_impl( pState, *pState ); if ( isInnermostCommonOuter_ || - is_in_highest_orthogonal_region< State >() && + ( is_in_highest_orthogonal_region< State >() && ( get_pointer( pOutermostUnstableState_ ) == - pState->State::outer_state_ptr() ) ) + pState->State::outer_state_ptr() ) ) ) { isInnermostCommonOuter_ = false; pOutermostUnstableState_ = pNewOutermostUnstableStateCandidate; diff --git a/boost/boost/test/floating_point_comparison.hpp b/boost/boost/test/floating_point_comparison.hpp index 9f4212f..2de5d63 100644 --- a/boost/boost/test/floating_point_comparison.hpp +++ b/boost/boost/test/floating_point_comparison.hpp @@ -79,17 +79,26 @@ inline FPT safe_fpt_division( FPT f1, FPT f2 ) { // Avoid overflow. - if( f2 < static_cast(1) && f1 > f2*fpt_limits::max_value() ) + if( (f2 < static_cast(1)) && (f1 > f2*fpt_limits::max_value()) ) return fpt_limits::max_value(); // Avoid underflow. - if( f1 == static_cast(0) || - f2 > static_cast(1) && f1 < f2*fpt_limits::min_value() ) + if( (f1 == static_cast(0)) || + ((f2 > static_cast(1)) && (f1 < f2*fpt_limits::min_value())) ) return static_cast(0); return f1/f2; } +// helper templates to prevent ODR violations +template +struct static_constant { + static T value; +}; + +template +T static_constant::value; + //____________________________________________________________________________// } // namespace tt_detail @@ -221,7 +230,7 @@ struct BOOST_TEST_DECL check_is_close_t { }; namespace { -check_is_close_t check_is_close; +const check_is_close_t& check_is_close = tt_detail::static_constant::value; } //____________________________________________________________________________// @@ -243,7 +252,7 @@ struct BOOST_TEST_DECL check_is_small_t { }; namespace { -check_is_small_t check_is_small; +const check_is_small_t& check_is_small = tt_detail::static_constant::value; } //____________________________________________________________________________// diff --git a/boost/boost/tuple/tuple_comparison.hpp b/boost/boost/tuple/tuple_comparison.hpp index 178bbb9..822cbe6 100644 --- a/boost/boost/tuple/tuple_comparison.hpp +++ b/boost/boost/tuple/tuple_comparison.hpp @@ -69,8 +69,8 @@ inline bool neq(const null_type&, const null_type&) { retur template inline bool lt(const T1& lhs, const T2& rhs) { return lhs.get_head() < rhs.get_head() || - !(rhs.get_head() < lhs.get_head()) && - lt(lhs.get_tail(), rhs.get_tail()); + ( !(rhs.get_head() < lhs.get_head()) && + lt(lhs.get_tail(), rhs.get_tail())); } template<> inline bool lt(const null_type&, const null_type&) { return false; } @@ -78,8 +78,8 @@ inline bool lt(const null_type&, const null_type&) { return template inline bool gt(const T1& lhs, const T2& rhs) { return lhs.get_head() > rhs.get_head() || - !(rhs.get_head() > lhs.get_head()) && - gt(lhs.get_tail(), rhs.get_tail()); + ( !(rhs.get_head() > lhs.get_head()) && + gt(lhs.get_tail(), rhs.get_tail())); } template<> inline bool gt(const null_type&, const null_type&) { return false; } diff --git a/boost/boost/wave/util/unput_queue_iterator.hpp b/boost/boost/wave/util/unput_queue_iterator.hpp index 618955c..7d78e62 100644 --- a/boost/boost/wave/util/unput_queue_iterator.hpp +++ b/boost/boost/wave/util/unput_queue_iterator.hpp @@ -219,7 +219,7 @@ public: // objects are equal and the base iterators are equal as well OtherDerivedT const &rhs = static_cast(x); return - (unput_queue.empty() && rhs.unput_queue.empty() || + ((unput_queue.empty() && rhs.unput_queue.empty()) || (&unput_queue == &rhs.unput_queue && unput_queue.begin() == rhs.unput_queue.begin() )