Turning off checkers

Is there any way to turn off specific checkers for the static analyzer?

I tried just adding one checker, e.g. -analyze-checker=core.DivideZero, but
the following set of checkers still seems to be implicitly enabled:

‘core’
‘unix’
‘deadcode’
‘security.insecureAPI.UncheckedReturn’
‘security.insecureAPI.getpw’
‘security.insecureAPI.gets’
‘security.insecureAPI.mktemp’
‘security.insecureAPI.mkstemp’
‘security.insecureAPI.vfork’

Thanks!

Sincerely,
Todd Nowacki

Todd,

What is your complete command line? Are you calling scan-build or clang?

Anna.

Hi!

I have a similar problem. I use scan-build and I’m testing a new checker but I got warnings from other checks which I did not explicitly enabled (like warning: Division by zero).

I use this command:
scan-build --use-analyzer /clang33/build/bin/clang -enable-checker cc.NewChecker -o ./CheckerResults make

Do I have to disable all the default checks? I tried to get the list of the default checkers (scan-build --help-checkers) but the list is empty and I still got the warnings from the other default checkers.

I’d like to get only the warnings created by the enabled checker. Did I miss something from the command line?

Thanks!

George

The analyzer assumes that the checkers from the core package always run, so it is not advisable to turn those off.

Currently, the only way to disable checkers is to list all the ones you are disabling. You should be able to disable the whole packages of checkers, which would make this simpler.

Anna.

Hi!

I have a similar problem. I use scan-build and I’m testing a new checker but I got warnings from other checks which I did not explicitly enabled (like warning: Division by zero).

I use this command:
scan-build --use-analyzer /clang33/build/bin/clang -enable-checker cc.NewChecker -o ./CheckerResults make

Do I have to disable all the default checks? I tried to get the list of the default checkers (scan-build --help-checkers) but the list is empty and I still got the warnings from the other default checkers.

To see the list of all analyzer checkers you can use:

clang -cc1 -analyzer-checker-help