Commit 036fb8770 ("checksum: add VSX fast path for POWER8/POWER9") changed
an #ifdef to #if defined, in order to match a newly introduced #if which
needs to check two different symbols. This causes clang-tidy to complain
that the directive could be written more concisely.
In this case consistency with the other #if branch seems more important,
and in general insisting on #ifdef over #if seems unhelpfully pedantic.
Suppress that warning globally.
Signed-off-by: David Gibson
---
.clang-tidy | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.clang-tidy b/.clang-tidy
index 9d346ec2..773121f5 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -81,6 +81,11 @@ Checks:
# precedence over addition in modern mathematical notation. Adding
# parentheses to reinforce that certainly won't improve readability.
- "-readability-math-missing-parentheses"
+
+ # #if defined(FOO) is fine, and can be more consistent with other
+ # #if directives. Don't insist on #ifdef instead.
+ - "-readability-use-concise-preprocessor-directives"
+
WarningsAsErrors: "*"
HeaderFileExtensions:
- h
--
2.53.0