Visual Studio Warning C4996

Viewed 29684

I'm getting the following warning

warning C4996: 'std::_Uninitialized_copy0': 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' c:\program files\microsoft visual studio 10.0\vc\include\memory 348

I can't seem to find any information that would help to combat this warning. By looking at the output it seems this warning has something to do with Boost.Signals2 and auto_buffer.

Is this safe to ignore or can I remove it somehow?

2 Answers

This error is generated because the code the compiler produces is not thread-safe. This means that if you are using multi-threaded coding, some of your stream I/O can (and probably will) get lost because the internal I/O buffers are shared. The suggested substitute functions will "eliminate" this problem.

Related