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?
Clang-tidy is a standalone linter tool for checking C and C++ source code files. It provides an additional set of compiler warnings—called checks—that go above and beyond what is typically included in a C or C++ compiler.
scan-build is a command line utility that enables a user to run the static analyzer over their codebase as part of performing a regular build (from the command line).
clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With