Boost logo

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:17:52


> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Sebastian Redl

> Chris Newbold wrote:
> > Here's an alternate proposal that does work: add a warning suppression
> to config/abi/msvc_prefix.hpp:
> >
> > @@ -3,6 +3,18 @@
> > // Boost Software License, Version 1.0. (See accompanying file
> > // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
> >
> > +#if defined(_M_X64)
> > + // warning: 'file': alignment changed after including header, may
> > + // be due to missing #pragma pack(pop)
> > + //
> > + // Changing the default structure alignment across header file
> > + // boundaries causes a warning on the x86_64 target. Unfortunately,
> > + // there is no way to do a push-pop on the state of this warning
> > + // since popping it back to the 'on' state results in a warning as
> > + // the compiler exits the suffix file
> > +# pragma warning(disable:4103)
> > +#endif
> > +
> > #pragma pack(push,8)
> >
> > Does this seem reasonable?

> I'd say msvc_suffix should reenable the warning with #pragma
> warning(default:4103).

Unfortunately that only pushes the problem one level higher. It seems that MSVC is not particularly intelligent about how and when to issue this warning.

The only way I've been able to successfully suppress it is to permanently disable it in msvc_prefix.hpp.

-Chris


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