Boost logo

Boost :

Subject: Re: [boost] boost::aligned_storage broken on VC12 for alignment values of 8
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2014-04-24 12:25:29


On Thu, Apr 24, 2014 at 5:22 AM, John Maddock wrote:
>
> Sorry to be so late in coming to this: this is both nasty but also
> apparently unfixable, on the one hand, VC++ basically lies about the
> alignment of some types:
> [snip]
>
> BTW this is true also of std::aligned_storage which also fails the final
> assert above. If instead we had:
>
> typedef __declspec(align(8)) struct some_struct_type align_t;
>
> Then the asserts all pass, but now align_t can not be passed through a
> function call by value. In fact this was a previous bug in the type traits
> lib: http://article.gmane.org/gmane.comp.lib.boost.devel/173011
>
> So we're basically screwed whatever we do.
>

*Nod*, I discovered shortly after that std::aligned_storage in VC was
similarly affected. Whle I expected __declspec(align(N)) to be at
least reliable (after a light test) that also is disappointgly not the
case for the reasons you've indicated.

Looks like MSVC-32 users should rely only upon Boost.Align's align()
or aligned_alloc() for alignment values of 8. :)

Glen


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