scan-build suppressions?

Are there mechanisms in scan-build (clang static analysis) for having
a suppressions file, much like the semantics suppressions files in
valgrind?

Barring a pre-existing mechanism or pugin, how can I get the report
from scan-build to tell me the function names along each edge of the
analysis path that leads to a reported fault?

Are there mechanisms in scan-build (clang static analysis) for having
a suppressions file, much like the semantics suppressions files in
valgrind?

Currently, there is no such file.

However, often there is a way to modify the analyzed code to suppress the false positives:
http://clang-analyzer.llvm.org/faq.html

Barring a pre-existing mechanism or pugin, how can I get the report
from scan-build to tell me the function names along each edge of the
analysis path that leads to a reported fault?

One way of getting these, would be by processing the scan-build output with clang/utils/analyzer/CmpRuns.py, which looks at all the reports and provides the APIs to examine each report.

It would look something like this:

runInfo = CmpRuns.SingleRunInfo(OutputDir, opts.root, opts.verboseLog)

runResults = CmpRuns.loadResultsFromSingleRun(runInfo, False)
for r in runResults.reports:

for d in r.diagnostics:

Right now, there is no API to get the names of all the functions along the path, but it would be reasonable to add the API that supports such query to the script. Also, we do have getIssueIdentifier(), which could be used to identify the same issues across multiple runs. It is very rough right now - we just store the function enclosing the report and the offset from the beginning of the function to the report.

Cheers,
Anna.

Are there mechanisms in scan-build (clang static analysis) for having
a suppressions file, much like the semantics suppressions files in
valgrind?

Currently, there is no such file.

However, often there is a way to modify the analyzed code to suppress the false positives:
http://clang-analyzer.llvm.org/faq.html

Barring a pre-existing mechanism or pugin, how can I get the report
from scan-build to tell me the function names along each edge of the
analysis path that leads to a reported fault?

One way of getting these, would be by processing the scan-build output with clang/utils/analyzer/CmpRuns.py, which looks at all the reports and provides the APIs to examine each report.

It would look something like this:

runInfo = CmpRuns.SingleRunInfo(OutputDir, opts.root, opts.verboseLog)

runResults = CmpRuns.loadResultsFromSingleRun(runInfo, False)
for r in runResults.reports:

for d in r.diagnostics:

Right now, there is no API to get the names of all the functions along the path, but it would be reasonable to add the API that supports such query to the script. Also, we do have getIssueIdentifier(), which could be used to identify the same issues across multiple runs. It is very rough right now - we just store the function enclosing the report and the offset from the beginning of the function to the report.

I forgot to mention that CmpRuns.py interprets the plist(not html) output format. So you would have to run scan-build with -plist-html option, which tells scan-build to produce both plist and html output.