Opened 16 years ago

Closed 15 years ago

Last modified 14 years ago

#775 closed Bugs (fixed)

Warnings on MSVC 2005

Reported by: e4lam Owned by: John Maddock
Milestone: Component: config
Version: None Severity: Problem
Keywords: Cc:

Description (last modified by René Rivera)

I've found that when using Boost on Microsoft Visual Studio C++ 2005, I get warning C4103 when 
including any boost header which end up including:

abi_{prefix,suffix}.hpp
(eg. iostreams/filter/zlib.hpp)

or which manually performs a 

#include BOOST_ABI_{PREFIX,SUFFIX}
(eg. regex/v4/regex_traits_defaults.hpp).

An explanation for the warning can be found here:
http://windowssdk.msdn.microsoft.com/en-us/library/t4d0762d.aspx

What is happening is that config/abi/msvc_{prefix,suffix}.hpp performs "#pragma 
pack(push,8)" (in msvc_prefix.hpp) and then performs a "#pragma pack(pop)" (in msvc_suffix.hpp). This leads the compiler to think that the packing alignment has erroneously changed, generating unnecessary warnings.

Attachments (1)

boost-1.34.1-warningfixes.patch (6.4 KB ) - added by ryan.gallagher@… 15 years ago.
patch for several msvc 4103 warnings

Download all attachments as: .zip

Change History (7)

comment:1 by René Rivera, 15 years ago

Component: buildconfig
Description: modified (diff)
Severity: Problem

comment:2 by John Maddock, 15 years ago

Resolution: Nonefixed
Status: assignedclosed

Fixed in SVN.

in reply to:  2 comment:3 by ryan.gallagher@…, 15 years ago

Replying to johnmaddock:

Fixed in SVN.

Where/how was this fixed? I'm looking at boost/filesystem/convenience.hpp in svn trunk and don't see a fix for at least this instance of it. Perhaps I missed how you fixed it, or was it in a different branch?

I have a patch at least for several instances of this if you'd like it. I'll attach it.

by ryan.gallagher@…, 15 years ago

patch for several msvc 4103 warnings

comment:4 by mstevens@…, 14 years ago

This is not fixed for the following files

*boost/system/error_code.hpp *boost/filesystem/path.hpp *boost/filesystem/operations.hpp

comment:5 by John Maddock, 14 years ago

Please note that abi_prefix.hpp has recently been changed, so this warning will no longer occur on Win64 builds with the default alignment settings. Also when this came up on the mailing list recently, we decided to deliberately leave the warnings in place should the user choose to change the default alignment settings.

Leaving closed for now.

John Maddock.

comment:6 by mstevens@…, 14 years ago

Thanks John,

With Boost 1.36.0 was getting the 4103 compiler warning compiling in 64-bit mode on MSVC 2008 (9.0). I silenced the warnings by changing these three files by surrounding #include <boost/config/abi_prefix.hpp> and #include <boost/config/abi/suffix.hpp> statements.

For example:

#ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #include <boost/config/abi_prefix.hpp> must be the last #include #ifdef BOOST_MSVC #pragma warning(pop) #endif

It sounds like you've taken care of this and I'll get the fix next time I download Boost. Thanks a lot for your work.

Mac Stevens mstevens@…

Note: See TracTickets for help on using tickets.