Boost logo

Boost :

Subject: Re: [boost] [optional] Strict Aliasing Warnings on Trunk
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-12-17 14:10:20


On Thu, Dec 17, 2009 at 10:07 AM, Giovanni Piero Deretta
<gpderetta_at_[hidden]> wrote:
> ... but the dynamic type of the internal buffer of boost::optional has
> been changed via placement new, so (modulo compiler bugs) it should be
> safe: at any time the buffer has a specific type (when initialized) or
> no type at all (it is just a bunch of memory). Boost optional only
> dereferences the buffer when it has been initialized, and always with
> the same type used for placement new. Of course this is hard
> (impossible?) to prove statically and gcc warns even if it should be
> perfectly safe .

We had a discussion about warnings some time ago, I think this is an
excellent example of a warning that warns about something important
yet it is completely useless. To someone who doesn't know the
semantics of reinterpret_cast, perhaps the warning has some value, but
for the rest of us what it really says is "Warning! You have used
reinterpret_cast!"

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk