Boost logo

Boost Users :

From: Benoit Hudson (benoit.hudson_at_[hidden])
Date: 2007-10-21 13:34:42


I'm trying to make sure my code compiles under gcc-4.3 before that
compiler comes out. I'm currently stuck on an error it reports in
boost, version 1.34.1 (which I downloaded seconds ago; error was also
present in 1.34.0):

In file included from ../boost/function/detail/prologue.hpp:16,
                 from ../boost/function.hpp:22,
                 from ../boost/iterator/transform_iterator.hpp:10,
                 from [my code]:
../boost/function/function_base.hpp: In member function 'const
std::type_info& boost::function_base::target_type() const':
../boost/function/function_base.hpp:485: error: dereferencing
type-punned pointer will break strict-aliasing rules

I don't understand how there's any type-punning going on at line 485,
although to my untrained eye it looks a lot like it's returning a ref
to a temporary. A couple lines later looks only very slightly
fishier, but still shouldn't be breaking any aliasing rules. So I
leave it to the experts to figure out what's going on here.

-- Benoît


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net