Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-02 05:38:55


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. 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;
}

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.

- Reece


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