如何禁用包含文件夹的警告?

bra*_*tao 5 c++ warnings compilation visual-studio

我必须使用一些库,没有权力改变它或关心它,EveryTime我编译了大量的警告弹出窗口.没用的东西就好

:警告C4350:行为改变:'std :: auto_ptr <_Ty> :: auto_ptr(std :: auto_ptr_ref <_Ty>)throw()'调用而不是'std :: auto_ptr <_Ty> :: auto_ptr(std :: auto_ptr <_Ty>&)throw()'

我想完成对此特定库的禁用警告.|但仍希望对我自己的代码发出警告.是否可以在Visual Studio 2010中使用?

ild*_*arn 7

#pragma warning是一个选项,虽然它可能只有在您自己的项目中使用预编译头文件或源文件很少时才可行.

#pragma warning (push)
#pragma warning (disable : 4350)
#include <third/party/headers/in/question.h>
#pragma warning (pop)
Run Code Online (Sandbox Code Playgroud)