How to disable Warnings for includes folders?

I have to use some library and cannot change it or take care of it, EveryTime I compile a huge number of pop-up warnings. Useless things like

: warning C4350: behavior change: 'std :: auto_ptr <_Ty> :: auto_ptr (std :: auto_ptr_ref <_Ty>) throw ()' instead of 'std :: auto_ptr <_Ty> :: auto_ptr (std :: auto_ptr <_Ty > &) throw () '

I want to complete the warning blocking for this particular library. | But still I want to have warnings for my own code. Is this possible in Visual Studio 2010?

+5
source share
2 answers

# pragma warning is one option, although this is only possible when you use precompiled headers or have very few source files in your own project.

#pragma warning (push)
#pragma warning (disable : 4350)
#include <third/party/headers/in/question.h>
#pragma warning (pop)
+7
source

Create your own header file (for example, "your_ABCD.h") using the code below.

// In your_ABCD.h
#pragma once
#pragma warning (disable : 4350)
#include <their_ABCD.h>
#pragma warning (default : 4350)

You can then include "your_ABCD.h" instead of the file "their_ABCD.h".

+3
source

All Articles