From d53a476a7721dfa053690e5ae80105e159b4678f Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Fri, 9 Jan 2026 14:24:42 +0300 Subject: [PATCH] Silence -Wstrict-aliasing warning in simd_vector.hpp. --- include/boost/uuid/detail/simd_vector.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/uuid/detail/simd_vector.hpp b/include/boost/uuid/detail/simd_vector.hpp index 4cee4cf..fde583b 100644 --- a/include/boost/uuid/detail/simd_vector.hpp +++ b/include/boost/uuid/detail/simd_vector.hpp @@ -27,12 +27,22 @@ union simd_vector > BOOST_FORCEINLINE operator Vector () const noexcept { return get< Vector >(); } +#if defined(BOOST_GCC) && (BOOST_GCC >= 40600) +#pragma GCC diagnostic push +// dereferencing type-punned pointer will break strict-aliasing rules +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif + template< typename Vector > BOOST_FORCEINLINE typename std::enable_if< sizeof(Vector) <= ByteSize, Vector >::type get() const noexcept { using vector_type = typename std::remove_cv< typename std::remove_reference< Vector >::type >::type; return *reinterpret_cast< const vector_type* >(bytes); } + +#if defined(BOOST_GCC) && (BOOST_GCC >= 40800) +#pragma GCC diagnostic pop +#endif }; template< typename T >