How to suppress warnings in external headers in Visual C++

brew-framework, brewmp, suppress-warnings, visual-c++

Solution

It seems like there is an answer to this.

this post talks about `/external:I` that can be used to include headers with a special set of warnings.

I have not tested it myself, but the blog post is from 2017.

Problem

I'm starting a new BREW project, and I'd like to compile with Warning Level 4 (/W4) to keep the application code nice and clean. The problem is that the BREW headers themselves don't compile cleanly with /W4. In gcc you can differentiate between application and system headers by using -I and -isystem, and then by default gcc doesn't report any compilation warnings in system headers. Is there an equivalent mechanism in Visual C++?

Original source