11

Both of these tools seem to share some common goals and while the documentation of clang-tidy is quite explicit about its capabilities, clang-check's is a bit sparse.

It would be nice if I could run only one of these tools while having the same checks in place. Obviously, clang-tidy has some features which are absent in clang-check, so the question is:

Is there a combination of checks for clang-tidy that includes all of the features of clang-check -analyze?

lbonn
  • 2,499
  • 22
  • 32

1 Answers1

7

After looking at the sources of both tools, clang-check -analyze instantiate an AnalysisASTConsumer from the StaticAnalyzer lib through here.

clang-tidy also does it if analyzer options are supplied.

So, everything seems to indicate that clang-tidy -check='clang-analyzer-*' is equivalent to clang-check -analyze.

lbonn
  • 2,499
  • 22
  • 32
  • 1
    Looks like it is broken. I took code from https://clang-analyzer.llvm.org/available_checks.html, put it in my code and ran `clang-tidy` with `clang-analyzer-*`. However I dont see any output related to warnings the above code supposed to produce – kreuzerkrieg Oct 22 '18 at 13:13