I am trying to configure clang-tidy for a project. I would like to have clean output and encourage the use of -fix mode where possible. However, there are some cases where an exception is required.
How can i use
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wreserved-id-macro"
for the equivalent case where you need to disable the compiler warning locally, is it possible to do something like this from clang-tidy?
I tried
#pragma clang diagnostic push #pragma clang diagnostic ignored "readability-identifier-naming"
as well as replacing clang with clang-tidy . Unfortunately, when using clang as the target of a pragma and compiling using regular clang, I get a compilation warning
warning: pragma diagnostic expected option name (eg "-Wundef") [-Wunknown-pragmas]
and
warning: unknown pragma ignored [clang-diagnostic-unknown-pragmas]
when compiling, if I use clang-tidy instead of clang . It does not affect what clang-tidy displays when run through the source.
This is with clang and clang-tidy 3.8 on x86_64 Linux.
c ++ clang ++ clang-tidy
Rich l
source share