How do I exclude library headers from my Visual Studio static code analysis?

二次信任 提交于 2019-12-05 02:44:33
James McNellis

You can disable all code analysis warnings for a particular block of code using #pragma warning in your code. MSDN provides the following example:

#include <codeanalysis\warnings.h>
#pragma warning( push )
#pragma warning ( disable : ALL_CODE_ANALYSIS_WARNINGS )
#include <third-party include files here>
#pragma warning( pop )

(See "How to: Enable and Disable Code Analysis for Specific C/C++ Warnings" for more information.)

To the best of my knowledge, there is no way to disable warnings from particular header files using only command line options.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!