Blair Fonville
Blair Fonville

Reputation: 928

How to run Code analysis on project files only

I have recently upgraded from Visual Studio 2012 to 2017 and I'm experimenting with the Code Analysis features (which seem to be far more capable than they were in 2012).

The problem I have is that I'll get many results for code dependencies, whereas I am really only interested in my own local project files. This is particularly true when I have Enable C++ Core Check (Released) enabled.

code analysis

For example, as shown above, I receive multitudes of analysis results for the boost libraries. There are tons of results for xerces-c, and other libraries which I'm using as well.

Is there a way to restrict the analysis to only those files which I have written myself (local to the project)?

Upvotes: 1

Views: 261

Answers (1)

1201ProgramAlarm
1201ProgramAlarm

Reputation: 32732

There isn't a flag or setting that I'm aware of to directly accomplish this, but you can get something close by using #pragma warning to change the warning level (or disable specific warnings) before you include those library headers, then restore the warning level before including your own.

It isn't perfect, and could result in suppressing warnings you'd want to see, but if you only disable them during Code Analysis that wouldn't be an issue.

Upvotes: 1

Related Questions