tzg
tzg

Reputation: 666

cov-analyze with list of checkers

What's the best way to enable a list of checkers in Coverity Analize. I've got a list of checkers but don't want to enable them all.

To enable all you can either leave blank or --all

cov-analyze --dir cov

or

cov-analyze --dir cov --all

I want to have a list like the following but many more . . .

cov-analyze --dir cov -en STRING_NULL -en NULL_RETURNS

Can you have a small text file to read? Or do you just have to list them all out?

Upvotes: 1

Views: 944

Answers (2)

Scott McPeak
Scott McPeak

Reputation: 12739

If you're mainly asking how to avoid listing all of the checkers on the command line, you could use a response file:

@@<response_file>

Specify a response file that contains a list of additional command line arguments, such as a list of files for analysis. Each line in the file is treated as one argument, regardless of spaces, quotes, etc.

With that, your analysis command line would look like:

cov-analyze --disable-default @@enable-checkers.txt <other options like --dir>

where enable-checkers.txt contains:

--enable
STRING_NULL
--enable
NULL_RETURNS
...

with the ... consisting of additional pairs of lines consisting of --enable followed by a checker name.

Upvotes: 3

irowe
irowe

Reputation: 626

From the Coverity documentation:

--disable-default Disables default checkers. This option is useful if you want to disable all default checkers, including Sigma checkers, and then enable only a few with the --enable option.

For a list of checkers that are disabled through this option, see the --enable option documentation for the cov-analyze command.

--enable <checker_name> -en <checker> Enables a checker that is not otherwise enabled by default. The checker name is case insensitive. This option will enable a checker for all languages supported by the checker.

Upvotes: 1

Related Questions