clang-check
, Clang's built-in static analysis tool, has an -analyze
option, for which the help string just says "Run static analysis engine." With this flag, I see very little output from running clang-check
on several of my files; without it, I see a lot of warnings.
Isn't running the static analysis engine the main purpose of running clang-check
, which is a static analysis tool? Why do I see less output when running the engine, and what does the tool do without the flag?
ClangCheck is a small wrapper around LibTooling which can be used to do basic error checking and AST dumping.
If you must enable or disable particular checks, use the clang-tidy command-line format in your . clang-tidy files. The command-line format specifies a comma-separated list of positive and negative globs: positive globs add subsets of checks, and negative globs (prefixed with - ) remove subsets of checks.
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.
Running clang-check
without any options runs the -fsyntax-only
mode (checking for correct syntax). Only if you specify -analyze
, the static analysis tool is executed, see http://clang-analyzer.llvm.org/available_checks.html for a full list of executed checks.
-fsyntax-only
and -analyze
at the same time.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