Skip to content

Commit 33aafd8

Browse files
Fix spurious warning spotted by -Werror
Including a real error :-)
1 parent 11ea8fd commit 33aafd8

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

include/xsimd/arch/generic/xsimd_generic_memory.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ namespace xsimd
3939
inline batch<IT, A> create_compress_swizzle_mask(I bitmask, ::xsimd::detail::index_sequence<Is...>)
4040
{
4141
batch<IT, A> swizzle_mask(IT(0));
42-
size_t i = 0;
4342
alignas(A::alignment()) IT mask_buffer[batch<IT, A>::size] = { Is... };
4443
size_t inserted = 0;
4544
for (size_t i = 0; i < sizeof...(Is); ++i)

include/xsimd/arch/xsimd_avx512f.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,10 +2033,12 @@ namespace xsimd
20332033
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)
20342034
{
20352035
assert(false && "not implemented yet");
2036+
return {};
20362037
}
20372038
else XSIMD_IF_CONSTEXPR(sizeof(T) == 2)
20382039
{
20392040
assert(false && "not implemented yet");
2041+
return {};
20402042
}
20412043
else XSIMD_IF_CONSTEXPR(sizeof(T) == 4)
20422044
{
@@ -2099,10 +2101,12 @@ namespace xsimd
20992101
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)
21002102
{
21012103
assert(false && "not implemented yet");
2104+
return {};
21022105
}
21032106
else XSIMD_IF_CONSTEXPR(sizeof(T) == 2)
21042107
{
21052108
assert(false && "not implemented yet");
2109+
return {};
21062110
}
21072111
else XSIMD_IF_CONSTEXPR(sizeof(T) == 4)
21082112
{

test/test_batch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ struct batch_test
101101
{
102102
batch_type b;
103103
// value initialized to random data, can't be checked
104+
(void)b;
104105

105106
array_type tmp;
106107
std::fill(tmp.begin(), tmp.end(), value_type(2));

test/test_batch_bool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ struct batch_bool_test
200200
{
201201
batch_bool_type a;
202202
// value uninitialized, cannot test it.
203+
(void)a;
203204

204205
bool_array_type res;
205206
batch_bool_type b(true);
@@ -368,6 +369,7 @@ struct batch_bool_test
368369
// FIXME: this volatile statement is useless on its own, but it
369370
// workaround a bug in MSVC 2022 on avx2 that shows up in CI.
370371
volatile auto _ = ((bool_g.half | bool_g.ihalf) == bool_g.all_true);
372+
(void)_;
371373
INFO("operator|");
372374
CHECK_UNARY(res);
373375
}

test/test_batch_constant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct constant_batch_test
125125

126126
constexpr auto n12_usub = -n12;
127127
constexpr auto n12_usub_ = xsimd::make_batch_constant<batch_type, constant<(value_type)-12>>();
128-
static_assert(std::is_same<decltype(n12_inv), decltype(n12_inv_)>::value, "-n12 == n12_usub");
128+
static_assert(std::is_same<decltype(n12_usub), decltype(n12_usub_)>::value, "-n12 == n12_usub");
129129
}
130130
};
131131

test/test_shuffle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ struct compress_test
323323
for (size_t i = 0; i < size; ++i)
324324
mask[i] = i % 2 == 0;
325325

326-
for (size_t i = 0, j = 0; i < size; ++i)
326+
for (size_t i = 0; i < size; ++i)
327327
expected[i] = i < size / 2 ? input[2 * i] : 0;
328328

329329
auto b = xsimd::compress(
@@ -337,7 +337,7 @@ struct compress_test
337337
for (size_t i = 0; i < size; ++i)
338338
mask[i] = i % 3 == 0;
339339

340-
for (size_t i = 0, j = 0; i < size; ++i)
340+
for (size_t i = 0; i < size; ++i)
341341
expected[i] = i < size / 3 ? input[3 * i] : 0;
342342

343343
auto b = xsimd::compress(

0 commit comments

Comments
 (0)