|
Boost : |
Subject: Re: [boost] warning policy issue
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2009-11-27 06:23:10
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On
Behalf Of Daniel James
> Sent: Thursday, November 26, 2009 11:07 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] warning policy issue
>
> There are a few warning conditions in Visual C++ 7.1 that were removed
> in later versions. I think their removal is a good indication of their
> worth (the ones I've come across were certainly buggy). They should
> probably just be suppressed with something like the following.
>
> #if defined(BOOST_MSVC)
> #pragma warning(push)
> #if BOOST_MSVC < 1400
> #pragma warning(disable:4244)
> #endif
> #endif
>
> // ....
>
> #if defined(BOOST_MSVC)
> #pragma warning(pop)
> #endif
If the problem is only with version 7.1, I agree this is the best policy.
The https://svn.boost.org/trac/boost/wiki/Guidelines/MaintenanceGuidelines
effectively suggest this (but using the BOOST_WORKAROUND macro)
"
If the warning is only for a specific compiler version, use this approach:
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(push)
#pragma warning(disable:4512) //assignment operator could not be generated
#endif
...
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
"
Does anyone have a problem with this guidance?
Paul
--- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk