warnings with VS2008 and Boost 1.44

Dear all, we try to use Boost 1.44 with our applications and we got the follow warnings: -gamma.hpp(1053) : warning C4701 -token_functions.hpp(220) : warning C4127 -find_format_store.hpp(74) : warning C4100 We have here a 'treat warning as error' polciy, so in effect we may have to add an extra header for some libraries which disables the warning locally and then includes the Boost library header (thru the #pragma push / pop mechanism).

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of gast128 Sent: Thursday, October 28, 2010 3:27 PM To: boost-users@lists.boost.org Subject: [Boost-users] warnings with VS2008 and Boost 1.44
Dear all,
we try to use Boost 1.44 with our applications and we got the follow warnings:
-gamma.hpp(1053) : warning C4701 -token_functions.hpp(220) : warning C4127 -find_format_store.hpp(74) : warning C4100
We have here a 'treat warning as error' polciy, so in effect we may have to add an extra header for some libraries which disables the warning locally and then includes the Boost library header (thru the #pragma push / pop mechanism).
Sorry about this. Getting warning free is not as easy as it looks (or should be). (I note we have tried to quiet warnings already, but it looks as though these are not working (for you at least), for reasons not yet clear to me). If you mail me (privately?) the full error messages you are getting, I will try to get these push'n'pop quieted - but not until 1.46 :-( All these warnings look spurious, and I think you can safely enclose and disable push'n'pop, as you suggest. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

On Thursday, October 28, 2010 11:02 AM, Paul A. Bristow wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of gast128 Sent: Thursday, October 28, 2010 3:27 PM To: boost-users@lists.boost.org Subject: [Boost-users] warnings with VS2008 and Boost 1.44
Dear all,
we try to use Boost 1.44 with our applications and we got the follow warnings:
-gamma.hpp(1053) : warning C4701 -token_functions.hpp(220) : warning C4127 -find_format_store.hpp(74) : warning C4100
We have here a 'treat warning as error' polciy, so in effect we may have to add an extra header for some libraries which disables the warning locally
and then includes the Boost library header (thru the #pragma push / pop mechanism).
Sorry about this. Getting warning free is not as easy as it looks (or should be).
(I note we have tried to quiet warnings already, but it looks as though these are not working (for you at least), for reasons not yet clear to me).
If you mail me (privately?) the full error messages you are getting, I will try to get these push'n'pop quieted - but not until 1.46 :-(
All these warnings look spurious, and I think you can safely enclose and disable push'n'pop, as you suggest.
Fair warning about Visual Studio: according to the help file at http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.90%29.aspx
The compiler only supports up to 56 #pragma warning statements in a compiland.
It is my experience that the compiler will ignore any "#pragma warning" lines after this limit has been reached, and it can be reached a lot faster than you might expect.

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Andrew Holden Sent: Thursday, October 28, 2010 7:17 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] warnings with VS2008 and Boost 1.44
On Thursday, October 28, 2010 11:02 AM, Paul A. Bristow wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of gast128 Sent: Thursday, October 28, 2010 3:27 PM To: boost-users@lists.boost.org Subject: [Boost-users] warnings with VS2008 and Boost 1.44
All these warnings look spurious, and I think you can safely enclose and disable push'n'pop, as you suggest.
Fair warning about Visual Studio: according to the help file at http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.90%29.aspx
The compiler only supports up to 56 #pragma warning statements in a compiland.
It is my experience that the compiler will ignore any "#pragma warning" lines after this limit has been reached, and it can be reached a lot faster than you might expect.
Sigh :-( The lengths to which Microsoft will go to discourage virtuous programming practices... Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Paul A. Bristow Sent: Friday, October 29, 2010 9:30 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] warnings with VS2008 and Boost 1.44
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Andrew Holden Sent: Thursday, October 28, 2010 7:17 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] warnings with VS2008 and Boost 1.44
On Thursday, October 28, 2010 11:02 AM, Paul A. Bristow wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of gast128 Sent: Thursday, October 28, 2010 3:27 PM To: boost-users@lists.boost.org Subject: [Boost-users] warnings with VS2008 and Boost 1.44
All these warnings look spurious, and I think you can safely enclose and disable push'n'pop, as you suggest.
Fair warning about Visual Studio: according to the help file at http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.90%29.aspx>
Limit also applies to VC2010 according to http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.100%29.aspx
The compiler only supports up to 56 #pragma warning statements in a compiland.
It is my experience that the compiler will ignore any "#pragma warning" lines after this limit has been reached, and it can be reached a lot faster than you might expect.
I'm sure it will happen easily when using Boost in Real Life. I've updated https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines with this information. It means that authors really ought to try to 'fix' warnings like this, rather than using this suppress mechanism. But I fear it means attempts to use warnings as errors globally are doomed to be more trouble than they are worth, mainly because some warnings are spurious (even MS admit this!) and are unlikely to be fixed. http://connect.microsoft.com/VisualStudio/feedback/details/586147/warning-c4 224-is-given-for-correct-code-if-ms-extensions-are-disabled and like the poor, warnings will always be with us :-( Paul
--- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

On Friday, October 29, 2010 1:42 PM, Paul A. Bristow wrote:
Fair warning about Visual Studio: according to the help file at
http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.90%29.aspx>
Limit also applies to VC2010 according to http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.100%29.aspx
The compiler only supports up to 56 #pragma warning statements in a compiland.
It is my experience that the compiler will ignore any "#pragma warning" lines after this limit has been reached, and it can be reached a lot faster than you might expect.
I'm sure it will happen easily when using Boost in Real Life.
It gets even easier when you include multiple products. A quick check has found push'n'pop in the C++ standard library, Windows.h, Intel's Threading Building Blocks, Boost, and our own code. I have some modules that generate several hundred warnings when they would generate none if not for this limit. Well, maybe one or two, but how will I ever find them in all that noise?
I've updated https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines
with this information.
It means that authors really ought to try to 'fix' warnings like this, rather than using this suppress mechanism.
But I fear it means attempts to use warnings as errors globally are doomed to be more trouble than they are worth, mainly because some warnings are spurious (even MS admit this!) and are unlikely to be fixed.
http://connect.microsoft.com/VisualStudio/feedback/details/586147/warnin g-c4
224-is-given-for-correct-code-if-ms-extensions-are-disabled
That's an amusing read. I especially enjoyed, "This warning is off-by-default in the compiler, and can only be turned on with /Wall (which is rare), or using /Za." In other words, Microsoft believes that people who use warnings, by definition, don't exist!
participants (3)
-
Andrew Holden
-
gast128
-
Paul A. Bristow