Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2005-11-02 07:43:28


"Reece Dunn" <msclrhd_at_[hidden]> writes:

> Anthony Williams wrote:
>>Can we disable the warning(s) with a pragma? If so, we could include the
>>pragma in boost.config (conditional on BOOST_USE_SECURE_STDLIB, as
>>suggested)
>
> The warnings can be disabled via pragmas on most (but not all) compilers,
> including MSVC and Borland.

Only VC8 currently issues these "deprecation" warnings. I know they can be
disabled through definining a preprocessor directive, but I do not know
whether there is a pragma for disabling them.

> The problem is locality... you don't want to
> disable the warnings globally because users might be dependant on some of
> those warnings. For example, disabling the "dead code" warning in
> Boost.Config would hide this subtle error:
>
> bool foo( int bar )
> {
> if( bar > 0 ) ; // oops!
> return true;
> return false;
> }

The warnings under consideration are the new warnings generated by VC8 about
"deprecation" of certain standard library functions, because they are deemed
"unsafe" by the VC compiler team. Since VC8 has only just been released, there
should be almost no existing code relying on this behaviour.

I agree that there are other warnings that we might rather didn't get
triggered in boost code, for those cases where we know it's spurious, but
which we don't want disabled for user code, such as your example.

> Disabling and restoring the warnings via pragmas in the warnings/push.hpp
> and warnings.pop.hpp headers is the best option as it restricts the locality
> to the Boost headers and doesn't spill over into user headers.

This might be a sensible suggestion for both the new "deprecation" warnings,
and other warnings generated by boost headers that are known to be spurious.

Anthony

-- 
Anthony Williams
Software Developer
Just Software Solutions Ltd
http://www.justsoftwaresolutions.co.uk

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