diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 5e4d6f0d3..9564bc283 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -43,7 +43,8 @@ T apply_bit_op(Bits a, Bits b, Func f) { T res; for(Index i = 0; i < data.size(); ++i) data[i] = f(a[i], b[i]); - std::memcpy(&res, &data, sizeof(T)); + // Note: The reinterpret_cast works around GCC's class-memaccess warnings: + std::memcpy(reinterpret_cast(&res), &data, sizeof(T)); return res; }