Reputation: 2060
I have to use some library, and have no power to change it or care about it, EveryTime i compile a HUGE number of warnings popup. Useless things like
: warning C4350: behavior change: 'std::auto_ptr<_Ty>::auto_ptr(std::auto_ptr_ref<_Ty>) throw()' called instead of 'std::auto_ptr<_Ty>::auto_ptr(std::auto_ptr<_Ty> &) throw()'
I want to complete disable Warnings to this specific library. |But still want to have warnings to my own code. Is it possible in Visual Studio 2010 ?
Upvotes: 5
Views: 1775
Reputation: 2181
Create your own header file ( like "your_ABCD.h" ) with the below code.
// In your_ABCD.h
#pragma once
#pragma warning (disable : 4350)
#include <their_ABCD.h>
#pragma warning (default : 4350)
Then, you can include "your_ABCD.h" instead of "their_ABCD.h" file.
Upvotes: 4
Reputation: 62975
#pragma warning is one option, though it's probably only feasible if 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)
Upvotes: 7