Boost logo

Boost :

Subject: Re: [boost] gcc-4.4.0 and boost::optional is giving (spurious?) strict-aliasing warnings
From: Matthew L. Creech (mlcreech_at_[hidden])
Date: 2009-05-06 11:57:24


On Wed, May 6, 2009 at 11:08 AM, Mathias Gaunard
<mathias.gaunard_at_[hidden]> wrote:
>
> Does it affect boost::variant too?
>

Yes, it does for me:

/home/mlcreech/svn/PCM-tk/trunk/vendor_export/include/boost/variant/detail/backup_holder.hpp:
In member function 'virtual int CTrendThread::wait_for_events()':
/home/mlcreech/svn/PCM-tk/trunk/vendor_export/include/boost/variant/detail/backup_holder.hpp:67:
warning: dereferencing pointer '<anonymous>' does break
strict-aliasing rules
/home/mlcreech/svn/PCM-tk/trunk/vendor_export/include/boost/variant/detail/cast_storage.hpp:33:
note: initialized from here

this is triggered by a call to boost::apply_visitor. I tried a couple
of simpler test cases with no problems, though.

GCC 4.4.0, compiling w/ "-Os -Wall -std=c++0x"
Boost 1.39

-- 
Matthew L. Creech

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