From 5b4e2797a28f9477d2df5fa915409dac73ff00c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Mon, 30 May 2022 16:16:41 +0200 Subject: [PATCH] Avoid -Wuninitialized warnings in GCC 12 --- include/boost/function/function_template.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index f62c4949..57ccf189 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -905,7 +905,11 @@ namespace boost { # pragma GCC diagnostic push // This warning is technically correct, but we don't want to pay the price for initializing // just to silence a warning: https://github.com/boostorg/function/issues/27 -# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# if (BOOST_GCC >= 120000) +# pragma GCC diagnostic ignored "-Wuninitialized" +# else +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# endif # endif std::memcpy(this->functor.data, f.functor.data, sizeof(boost::detail::function::function_buffer)); # if defined(BOOST_GCC) && (BOOST_GCC >= 40700) @@ -1003,7 +1007,11 @@ namespace boost { # pragma GCC diagnostic push // This warning is technically correct, but we don't want to pay the price for initializing // just to silence a warning: https://github.com/boostorg/function/issues/27 -# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# if (BOOST_GCC >= 120000) +# pragma GCC diagnostic ignored "-Wuninitialized" +# else +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# endif # endif std::memcpy(this->functor.data, f.functor.data, sizeof(this->functor.data)); # if defined(BOOST_GCC) && (BOOST_GCC >= 40700)