LEPT0N
LEPT0N

Reputation: 51

VS2013: How to disable warnings for included header files outside of the project

In my project I include a header file provided by an external library. With /W3 everything compiles without warnings. However, I want my project to compile cleanly with /W4. That's no problem for my code, but the external header spits out a ton of warnings. I know that I can do something like this:

#pragma warning( push )
#pragma warning( disable: #### )
// include here
#pragma warning( pop )

However there is a long list of warnings to disable. Is there a way that I can set the warning level back to /W3 when including this header while still compiling the rest of my code with /W4?

Thanks!

Upvotes: 4

Views: 1432

Answers (1)

James McNellis
James McNellis

Reputation: 355297

#pragma warning(push, 3)
// include here
#pragma warning(pop)

See the documentation for details.

Upvotes: 1

Related Questions