|
Boost : |
Subject: Re: [boost] Win64 and abi_prefix.hpp/abi_suffix.hpp warnings
From: Chris Newbold (Chris.Newbold_at_[hidden])
Date: 2008-09-25 13:47:47
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Chris Newbold
> Sent: Thursday, September 25, 2008 10:35 AM
> I'm unclear on the rationale for forcing 8-byte alignment in
> config/abi/msvc_(pre|suf)fix.hpp: 8-byte alignment is the compiler
> default. Is there concern over Boost headers being included in a context
> where the alignment has been otherwise artificially altered?
I'm starting to question the wisdom of unconditionally forcing 8-byte alignment in the MSVC ABI headers, particularly given that this happens on two architectures (x86 and x86_64) that have different pointer widths.
I can see some merit to enforcing a uniform alignment for Boost to avoid ABI issues due to users' project settings, etc., but I think that we need to account for the fact that different architectures have different default alignments. On x86_64, the default alignment for MSVC is 16 bytes.
However, changing msvc_prefix.hpp to look like...
#if defined(_M_X64)
# pragma pack(push,16)
#else
# pragma pack(push,8)
#endif
... is only an incomplete solution. It suppresses the warnings in the default case where the user has not already changed the alignment. If, for whatever reason, the user has changed the default alignment they're going to start getting the warnings again.
I think the only solution is to combine this change (so that Boost uses the "true" default alignment on x86_64) with the big-hammer disable-the-warning-for-good change.
-Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk