From ea36b01d4c39f609f2d08698bf7b23fc7bc81007 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Thu, 30 Nov 2023 15:25:38 +0100 Subject: [PATCH] Fix spurious warning spotted by -Werror Including a real error :-) --- include/xsimd/arch/generic/xsimd_generic_memory.hpp | 1 - test/test_batch.cpp | 1 + test/test_batch_bool.cpp | 2 ++ test/test_batch_constant.cpp | 2 +- test/test_shuffle.cpp | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/xsimd/arch/generic/xsimd_generic_memory.hpp b/include/xsimd/arch/generic/xsimd_generic_memory.hpp index ca5ebd0cc..e9e906583 100644 --- a/include/xsimd/arch/generic/xsimd_generic_memory.hpp +++ b/include/xsimd/arch/generic/xsimd_generic_memory.hpp @@ -39,7 +39,6 @@ namespace xsimd inline batch create_compress_swizzle_mask(I bitmask, ::xsimd::detail::index_sequence) { batch swizzle_mask(IT(0)); - size_t i = 0; alignas(A::alignment()) IT mask_buffer[batch::size] = { Is... }; size_t inserted = 0; for (size_t i = 0; i < sizeof...(Is); ++i) diff --git a/test/test_batch.cpp b/test/test_batch.cpp index 4a34b3b38..9c3217361 100644 --- a/test/test_batch.cpp +++ b/test/test_batch.cpp @@ -101,6 +101,7 @@ struct batch_test { batch_type b; // value initialized to random data, can't be checked + (void)b; array_type tmp; std::fill(tmp.begin(), tmp.end(), value_type(2)); diff --git a/test/test_batch_bool.cpp b/test/test_batch_bool.cpp index d5914bb0c..94d619af9 100644 --- a/test/test_batch_bool.cpp +++ b/test/test_batch_bool.cpp @@ -200,6 +200,7 @@ struct batch_bool_test { batch_bool_type a; // value uninitialized, cannot test it. + (void)a; bool_array_type res; batch_bool_type b(true); @@ -368,6 +369,7 @@ struct batch_bool_test // FIXME: this volatile statement is useless on its own, but it // workaround a bug in MSVC 2022 on avx2 that shows up in CI. volatile auto _ = ((bool_g.half | bool_g.ihalf) == bool_g.all_true); + (void)_; INFO("operator|"); CHECK_UNARY(res); } diff --git a/test/test_batch_constant.cpp b/test/test_batch_constant.cpp index 76e64c78c..7b00acc4e 100644 --- a/test/test_batch_constant.cpp +++ b/test/test_batch_constant.cpp @@ -125,7 +125,7 @@ struct constant_batch_test constexpr auto n12_usub = -n12; constexpr auto n12_usub_ = xsimd::make_batch_constant>(); - static_assert(std::is_same::value, "-n12 == n12_usub"); + static_assert(std::is_same::value, "-n12 == n12_usub"); } }; diff --git a/test/test_shuffle.cpp b/test/test_shuffle.cpp index d7e8458fa..5b03a20e5 100644 --- a/test/test_shuffle.cpp +++ b/test/test_shuffle.cpp @@ -323,7 +323,7 @@ struct compress_test for (size_t i = 0; i < size; ++i) mask[i] = i % 2 == 0; - for (size_t i = 0, j = 0; i < size; ++i) + for (size_t i = 0; i < size; ++i) expected[i] = i < size / 2 ? input[2 * i] : 0; auto b = xsimd::compress( @@ -337,7 +337,7 @@ struct compress_test for (size_t i = 0; i < size; ++i) mask[i] = i % 3 == 0; - for (size_t i = 0, j = 0; i < size; ++i) + for (size_t i = 0; i < size; ++i) expected[i] = i < size / 3 ? input[3 * i] : 0; auto b = xsimd::compress(