Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does clang-tidy make clang-check redundant?

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?

like image 425
lbonn Avatar asked Apr 20 '18 14:04

lbonn


Video Answer


1 Answers

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.

like image 97
lbonn Avatar answered Oct 15 '22 22:10

lbonn