From 616e652bd768972e98953d1ff80bd2d8790a336b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 21 Apr 2022 21:06:14 +0300 Subject: [PATCH] Suppress strict-aliasing warning for gcc 4.8 to 6 --- include/boost/system/detail/error_category_impl.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/boost/system/detail/error_category_impl.hpp b/include/boost/system/detail/error_category_impl.hpp index 30ae9f4..d165df9 100644 --- a/include/boost/system/detail/error_category_impl.hpp +++ b/include/boost/system/detail/error_category_impl.hpp @@ -139,6 +139,11 @@ inline BOOST_NOINLINE void error_category::init_stdcat() const } } +#if defined( BOOST_GCC ) && BOOST_GCC >= 40800 && BOOST_GCC < 70000 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + inline error_category::operator std::error_category const & () const { if( id_ == detail::generic_category_id ) @@ -179,6 +184,10 @@ inline error_category::operator std::error_category const & () const return *static_cast( static_cast( stdcat_ ) ); } +#if defined( BOOST_GCC ) && BOOST_GCC >= 40800 && BOOST_GCC < 70000 +#pragma GCC diagnostic pop +#endif + } // namespace system } // namespace boost