11

clang's scan-build driver for the static analyzer generates pretty html reports. But these only contain the issues the analyzer finds.

Is there way to generate the same kind of reports for warnings (and errors) from the compiler itself?

1 Answer 1

2

I found no documentation about this, so I dug around the clang source code.

It turns out that scan-build and ccc-analyzer (both perl scripts) don't output these error reports. Rather, the generation of the HTML reports is actually part of the clang compiler. The scan-build script simply ties together the various output files and adds a report index.

See

http://clang.llvm.org/doxygen/HTMLDiagnostics_8cpp_source.html

for the Clang source code.

To get clang to generate HTML reports for normal warnings/errors would require using the HTMLDiagnostics outside of the static analyzer. I know very little about Clang/LLVM internals, so I'm not sure how much effort this would require.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.