
On Mon, Jul 11, 2011 at 4:35 PM, Robert Ramey <ramey@rrsd.com> wrote:
Beman Dawes wrote:
A 1.47.0 VC++ 10.0 build of Boost produced a lot of stupid warnings from Serialization in the form c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility(2227) : warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
These can be shut off various ways, such as sticking "#include <boost/config/warning_disable.hpp>" at the start of the file being compiled.
Hmmm - it would seem to me the easiest and least intrusive way to deal with this is tweak the bjam build script. I build an test with MSVC 9.0 which also has this "facility" and I don't get the errors so maybe the build script already has this in it. I'll look into it.
The problem with lowering the warning level (as Daniel James suggested WRT iostreams) or in some way tweaking the build script is (1) Some warnings may be caused by coding errors, and the only way to determine that is to look at the code. At that point we might as well just fix the code to shut off the warning, thus signalling the developer understood what was happening and with that knowledge wished to suppress the warning. (2) Not everyone builds with b2 (previously known as bjam), so these folks benefit if the source of the warning rather than just some build setting quiets the warning, and (3) some (mistaken, IMO) organizational polices requires all code compile without warnings, so these folks are happier if Boost produces no warnings. It isn't a big thing, but where we are so close to a no warnings build, it seem worthwhile to take care of the few warnings remaining. --Beman