I have the problem that clang not only checks my code but also 3rd party lib's and automatic generated code for the diagnostic flags which I provided. How can I tell not to do so?
I use catkin-tools
and clang to build my c++ project where I use a config file for catkin which provides the cmake args
cmake_args:
# Enable most warnings
- -DCMAKE_CXX_FLAGS=-Werror -Wall -Wextra -Wfloat-equal -isystem=/usr/include/eigen3/
Initially I wanted to add -Wfloat-equal
as a diagnostic and the build should fail if it is found somewhere. But while building I found out that there are multiple paths which I need to exclude from the diagnostic check like
/usr/include/eigen3
/opt/ros/melodic
~/ws/src/devel/
I tried to add /usr/include/eigen3/
as a system header path, but this did not work. So how do I exclude the listed directories ? For clang-tidy
I used the .clang-tidy
file where I specified the header-filter
via a regex
HeaderFilterRegex: '.*/ws/src/.*'
which works as intended. And for the regex I can also exclude the one sub folder in my ws
. Unfortunately the -Wfloat-equal
is only part of the clang diagnostics but not of clang-tidy diagnostics