Skip to content

Commit

Permalink
Avoid -Wuninitialized warnings in GCC 12
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 30, 2022
1 parent 5e1a4f4 commit 5b4e279
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/boost/function/function_template.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5b4e279

Please sign in to comment.