Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2008-04-06 05:16:38


Beman Dawes wrote:
> Leaving aside the _SECURE_SCL 0 question, I think we need a boost
> header
> file that wraps up the needed code. This header should not be included
> in Boost headers, since doing so gets in user's way. But it would be
> useful in library sources like error_code.cpp and test programs.
>
> Building on Hartmut's suggestion, the header might look like this:
>
> //
> // silence 'secure' and 'deprecate' warnings
> //
> #if (_MSC_VER >= 1400) && !defined(BOOST_ENABLE_DEPRECATE_WARNINGS)
> # ifndef _CRT_SECURE_NO_DEPRECATE
> # define _CRT_SECURE_NO_DEPRECATE
> # endif
> # ifndef _SCL_SECURE_NO_DEPRECATE
> # define _SCL_SECURE_NO_DEPRECATE
> # endif
> #endif
>
> #if (_MSC_VER >= 1400) && !defined(BOOST_ENABLE_SECURE_WARNINGS)
> # ifndef _CRT_SECURE_NO_WARNINGS
> # define _CRT_SECURE_NO_WARNINGS
> # endif
> # ifndef _SCL_SECURE_NO_WARNINGS
> # define _SCL_SECURE_NO_WARNINGS
> # endif
> #endif
>
> Perhaps name it <boost/config/silence_misfeatures.hpp> or similar. I
> don't want a Microsoft specific name since it might be useful later
> for
> other compiler misfeatures.
>
> I'd add a comment explaining not to use it in user-visible code like
> boost/ headers.

Unfortunately - and as already noted by Peter Dimov - defining these macros
has an impact on the ABI comparibity of the code, so I don't believe we can
do that :-(

We might be able to use #pragma's to just turn the warnings unconditionally
off though - so in effect the header would have the same effect.

Let me experiment with that, John.


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