Add GCC's "-Wuninitialized" workaround. When initializing the pointer of flags part of an uninitialized pointer plus bit object, the other part is used uninitialized. It's harmless warning but annoying for the user.

This commit is contained in:
Ion Gaztañaga committed 2017-12-09 13:01:02 +01:00
1 parent 4f9e77acfe
commit 71317671ec
2 files changed
+22

No files matched your search

@@ -22,6 +22,17 @@
# pragma once
#endif
//GCC reports uninitialized values when an uninitialized pointer plus bits type
//is asigned some bits or some pointer value, but that's ok, because we don't want
//to default initialize parts that are not being updated.
#if defined(BOOST_GCC)
# if (BOOST_GCC >= 40600)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized"
# endif
#endif
namespace boost {
namespace intrusive {
@@ -89,6 +100,10 @@ struct pointer_plus_bits<T*, NumBits>
} //namespace intrusive
} //namespace boost
#if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
# pragma GCC diagnostic pop
#endif
#include <boost/intrusive/detail/config_end.hpp>
#endif //BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP