|
Boost : |
Subject: [boost] [wave][function] Suppressing gcc-4.4.1 warnings
From: John Maddock (john_at_[hidden])
Date: 2009-11-05 07:17:42
Looks like the new type-punning warnings from gcc-4.4.1 are false positives
(but I'd like someone else to confirm that!).
The fixes below illustrate how to suppress them simply by declaring a
temporary variable.
HTH, John.
Index: boost/wave/util/flex_string.hpp
===================================================================
--- boost/wave/util/flex_string.hpp (revision 57230)
+++ boost/wave/util/flex_string.hpp (working copy)
@@ -1211,7 +1211,10 @@
};
Storage& Data() const
- { return *reinterpret_cast<Storage*>(buf_); }
+ {
+ Storage* p = reinterpret_cast<Storage*>(buf_);
+ return *p;
+ }
RefCountType GetRefs() const
{
Index: boost/function/function_base.hpp
===================================================================
--- boost/function/function_base.hpp (revision 57230)
+++ boost/function/function_base.hpp (working copy)
@@ -316,11 +316,13 @@
new ((void*)&out_buffer.data) functor_type(*in_functor);
if (op == move_functor_tag) {
- reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor();
+ functor_type* f =
reinterpret_cast<functor_type*>(&in_buffer.data);
+ f->~Functor();
}
} else if (op == destroy_functor_tag) {
// Some compilers (Borland, vc6, ...) are unhappy with
~functor_type.
- reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
+ functor_type* f =
reinterpret_cast<functor_type*>(&out_buffer.data);
+ f->~Functor();
} else if (op == check_functor_type_tag) {
const BOOST_FUNCTION_STD_NS::type_info& check_type
= *out_buffer.type.type;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk