
On Mon, Jul 11, 2011 at 3:22 PM, Stephan T. Lavavej <stl@exchange.microsoft.com> wrote:
[Beman Dawes]
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'
[Robert Ramey]
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.
By the way - these warnings are noisy, but they're not completely pointless. They're triggered by calling STL algorithms with raw pointers as output iterators, or with user-defined iterators that aren't marked as "checked".
I'd appreciate warnings that catch bad pointers, but getting a warning just because I'm using a pointer is silly. What is the programmer expected to do? Be more careful? This reminds me of the "Baby on board!" stickers people put on their cars: do they target the careful driver who needs extra discouragement from crashing into cars? Or perhaps the reckless driver who would happily crash into you, except if you have a baby on board? Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode