Click here to Skip to main content
14,382,664 members
Rate this:
Please Sign up or sign in to vote.
What is the default analysis ruleset for the C++ Static Analysis ?

I can enable is with the /analyze flag.

MSDN just says "Turns on analysis in the default mode."

BTW, I know I can enable the analysis in the Code Analysis project property and that works.

What I have tried:

I tried tweaking some of the default ruleset files, but it looks like they are not used.

I even tried to explicitly use the full /analyze:ruleset NativeMinimumRules.ruleset flag but it does not work.
The complete line:
/analyze:ruleset "c:\users\lincourM\Desktop\NativeRecommendedRules.ruleset"

the ruleset contains :
<Rule Id="C6001" Action="Error" />
<Rule Id="C6011" Action="Error" />

and I get warnings instead of errors:

1>c:\users\lincourm\documents\project\teststaticanalysis\teststaticanalysis\teststaticanalysis.cpp(9): warning C6011: Dereferencing NULL pointer 'p'. : Lines: 8, 9
1>c:\users\lincourm\documents\project\teststaticanalysis\teststaticanalysis\teststaticanalysis.cpp(23): warning C6001: Using uninitialized memory 'i'.: Lines: 17, 18, 23
Updated 1-Oct-18 9:20am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100