Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2006-06-27 06:23:20

I have raised this issue before, inconclusively, but the question has now
become more urgent now that I am packaging some math functions produced by
John "Doing the Impossible" Maddock.

IMO Boost-worthy code should be able to be compiled in strict mode, for MSVC
level 4, without producing a blizzard of warnings.

Including a list of warnings that the authors of the library consider
unhelpful, and in some cases, unfixable (specifically the warning
"conditional expression is constant. ")

by using, for example

#ifdef _MSC_VER
# pragma warning(disable: 4127) // conditional expression is constant.
# pragma warning(disable: 4100) // unreferenced formal parameter.
# pragma warning(disable: 4512) // assignment operator could not be
# pragma warning(disable: 4996) // 'std::char_traits<char>::copy' was
declared deprecated.
// needed ifndef _SCL_SECURE_NO_DEPRECATE or == 0
// #define _SCL_SECURE_NO_DEPRECATE = 1 // Avoid C4996 warning.
// #define _SCL_SECURE_NO_DEPRECATE = 0 // get C4996 warning.

is fine for that package, but also supresses these warnings for other code,
which users rightly object to.

It also doesn't help other platforms, except to list the ignorable warnings.

Pushing and poping warning levels is VERY tedious, and almost impractiable,
and doesn't help non-MSVC platforms.

What is the best way to deal with this?

Is it to provide for MSVC includable files, say math_strict.hpp,
test_strict.hpp, filesystem_strict.hpp ... containing the above (tailored
for the library, if necessary)?

What about other platforms?


Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS

Boost list run by bdawes at, gregod at, cpdaniel at, john at