From 0634c9a6ac22d520ea63beab44ade590816f7f9e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Feb 2023 14:56:42 -0500 Subject: Suppress/fix new warnings in clang-tidy 15 --- .clang-tidy | 1 + test/.clang-tidy | 1 + test/test_ring.c | 8 +++----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 16f6ecc..5380ced 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -4,6 +4,7 @@ Checks: > *, -altera-*, + -bugprone-assignment-in-if-condition, -hicpp-multiway-paths-covered, -llvmlibc-*, -readability-identifier-length, diff --git a/test/.clang-tidy b/test/.clang-tidy index 16da00c..2d684a6 100644 --- a/test/.clang-tidy +++ b/test/.clang-tidy @@ -10,6 +10,7 @@ Checks: > -cppcoreguidelines-avoid-non-const-global-variables, -google-readability-casting, -llvm-header-guard, + -modernize-macro-to-enum, -performance-no-int-to-ptr, -readability-function-cognitive-complexity, InheritParentConfig: true diff --git a/test/test_ring.c b/test/test_ring.c index c61b3a3..8f56902 100644 --- a/test/test_ring.c +++ b/test/test_ring.c @@ -49,16 +49,14 @@ reader(void* ZIX_UNUSED(arg)) { printf("Reader starting\n"); - int ref_msg[MSG_SIZE]; // Reference generated for comparison - int read_msg[MSG_SIZE]; // Read from ring - unsigned count = 0; - int start = gen_msg(ref_msg, 0); + int ref_msg[MSG_SIZE]; // Reference generated for comparison + int read_msg[MSG_SIZE]; // Read from ring + int start = gen_msg(ref_msg, 0); for (unsigned i = 0; i < n_writes; ++i) { if (zix_ring_read_space(ring) >= MSG_SIZE * sizeof(int)) { if (zix_ring_read(ring, read_msg, MSG_SIZE * sizeof(int))) { assert(cmp_msg(ref_msg, read_msg)); start = gen_msg(ref_msg, start); - ++count; } } } -- cgit v1.2.1