3

I have a C++ code for which I use clang-tidy static analyzer. This code has its own headers and uses external libraries, and is usually compiled thanks to cmake. To make sure clang-tidy check my headers but not the ones from external libraries, I export the compile_commands.json with cmake (differentiating them by -I/my_include and -isystem/external_libs) then I simply run the command:

clang-tidy -header-filter=.* ./src/example.cpp -p=./

This is what I am doing and it was working perfectly with clang-tidy 10, 11 and 12.

Recently, I started to upgrade my clang-tidy to version 13.0.1-r1 (on alpine docker image), and now the same procedure (and same code) returns me tons of errors from the external libraries.

I have been trying different things, especially to setup cmake to run clang-tidy instead of the previous command line, but nothing worked.

So why clang-tidy 13 do not ignore system header as 12 was ? And how to make clang-tidy 13 actually ignore system headers (external) ?

R. N
  • 707
  • 11
  • 31

0 Answers0