Boost logo

Boost Users :

Subject: Re: [Boost-users] function_base.hpp type-punned pointer warnings
From: KSpam (keesling_spam_at_[hidden])
Date: 2011-03-10 13:05:37


On Thursday 10 March 2011 09:59:35 Peter Dimov wrote:
> "KSpam" wrote:
> > This has been a known problem for a very long time, and the work around
> > is quite simple. Replace
> >
> > reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor();
> >
> > with
> >
> > functor_type* p = reinterpret_cast<functor_type*>(&in_buffer.data);
> > p->~Functor();
>
> Note however that this replacement causes a warning on MSVC ('p' not used),
> so it needs to be conditional, as in
>
> https://svn.boost.org/trac/boost/changeset/69251

I have run my patch on MSVC (8, 9, and 10) and GCC, and I do not recall seeing
warnings from MSVC. Isn't p being used to call the destructor?

>
> Is there a ticket?

I do not know.

Respectfully,
Justin


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