Boost logo

Boost :

Subject: Re: [boost] [lockfree] _ENABLE_ATOMIC_ALIGNMENT_FIX for VS 2015Update 2
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2016-05-10 11:58:34


[Andrey Semashev]
> IMHO, it should be fixed in MSVC. The error should be opt-in,

Users don't discover opt-in features.

> Or (more preferably) just fix the bug by default, with no errors or warnings,

I initially planned to do that, but the fix affects layout, which breaks binary compatibility.

[Tim Blechmann]
> so yes, please make it a warning, but not an error.

Users ignore warnings. Faced with silent bad codegen for the majority of users (Lockfree is very unusual in that it's manually aligning), or breaking binary compatibility for users who mix RTM/Update 1 with Update 2 code (extremely common, especially when third-party libraries are involved), I felt that the best choice was to detect and emit the static_assert.

[Peter Dimov]
> You can in principle fix that by adding __declspec(align(4)) to tagged_index on MSVC.
[Andrey Semashev]
> ...or a more portable BOOST_ALIGNMENT(4).

Yeah, that should be ideal - much better than defining the enable-fix macro in the library or the test.

Thanks,
STL


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