diff options
| author | Jon Maloy <jmaloy@redhat.com> | 2026-11-19 20:32:47 -0500 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-11-22 22:06:25 +0100 |
| commit | 16bf5c49fa8706613318ac17ea7b5682a6e2cf41 (patch) | |
| tree | caee44c4335d21dd5eac09ae6f3af23e951288d4 | |
| parent | 4f656c0f08e0ab36df88a52c6b36f4ac3dc419d2 (diff) | |
| download | passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar.gz passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar.bz2 passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar.lz passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar.xz passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.tar.zst passt-16bf5c49fa8706613318ac17ea7b5682a6e2cf41.zip | |
clang-tidy: Disable checks new in clang-tidy 23
clang-tidy 23 introduces three new checks, which make
'make clang-tidy' fail on code that's otherwise fine:
- readability-trailing-comma wants a trailing comma in every
multi-line initialiser list, and none in single-line ones. That's
not part of our coding style, and it reports about 30 sites
(dhcpv6.c, ndp.c, netlink.c, pcap.c, tap.c, ...)
- readability-redundant-nested-if wants nested if statements merged
into a single condition, also where the inner condition has side
effects, as in bind() or setsockopt() calls, or a dedicated comment
(util.c, tcp.c, ...). Merging those would hurt readability, much
like the braces-around-statements checks we already disable
- bugprone-assignment-in-selection-statement, which cert-exp45-c is
now an alias of, reports assignments in conditions (conf.c, flow.c,
udp.c), like bugprone-assignment-in-if-condition, which we already
disable for the same reasons
Disable these checks.
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | .clang-tidy | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/.clang-tidy b/.clang-tidy index ec570f2..6aceb44 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,8 +9,11 @@ Checks: - "-cppcoreguidelines-init-variables" # Dubious value over the compiler's built-in warning. Would - # increase verbosity. + # increase verbosity. Same for its broader variant, added in + # clang-tidy 23, also known as cert-exp45-c - "-bugprone-assignment-in-if-condition" + - "-bugprone-assignment-in-selection-statement" + - "-cert-exp45-c" # Debatable whether these improve readability, right now it would look # like a mess @@ -99,6 +102,15 @@ Checks: # be treated directly as a bool. - "-readability-implicit-bool-conversion" + # Wants trailing commas in multi-line initialiser lists, and none in + # single-line ones. Not part of our coding style, and enforcing it + # would mean churn all over the place for no practical benefit. + - "-readability-trailing-comma" + + # Merging nested if statements would often hurt readability, e.g. + # where the inner condition has side effects or a separate comment. + - "-readability-redundant-nested-if" + WarningsAsErrors: "*" HeaderFileExtensions: - h |
