Currently, in VS, the warning suppression function from third-party libraries is still experimental, but certainly suitable.
Version VS 2017 15.6. In preview mode 1, there is a function to suppress warnings from third-party libraries. In the next article, they use "external headers" as a term to refer to the headers of third-party libraries.
https://blogs.msdn.microsoft.com/vcblog/2017/12/13/broken-warnings-theory/
The above article basically says that
- specify external headers
- specify warning level for external headers
to suppress warnings from them. For example, if we have external headers in the some_lib_dir directory and we want to compile our code in my_prog.cpp , which depends on the external headers, the following command should complete the task.
cl.exe /experimental:external /external:I some_lib_dir /external:W0 /W4 my_prog.cpp
Note that /experimental:external is required because it is still an experimental function, and the details of this function may change in the future.
In any case, we need to wait for the future version of Visual Studio.
source share