Visual Studio警告C4996

Ant*_*ony 34 c++ warnings

我收到了以下警告

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

我似乎无法找到任何有助于打击此警告的信息.通过查看输出,这个警告似乎与Boost.Signals2和auto_buffer有关.

这样可以安全忽略,还是可以以某种方式将其删除?

sse*_*vic 53

首先,我想说我非常喜欢编译器警告.我用-Wall -Wextra调用gcc.

但是,MSVC警告C4996主要触发完全有效的代码.警告文本中提出的更改通常会严重影响代码的可移植性,而它们从未大幅提高代码质量.因此,我经常在我的MSVC项目中禁止此警告(项目属性 - > C++ - >高级 - >禁用特定警告).

检查这个那个讨论.