From 743c92528639f466eb887655b5f0fa872105326a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 5 Nov 2019 19:06:12 +0000 Subject: [PATCH] test/packetmath: Silence alignment warnings --- test/packetmath.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 64dd3dbf6..00f5f042b 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -39,9 +39,12 @@ bits(const T& x) { // The following implement bitwise operations on floating point types template T apply_bit_op(Bits a, Bits b, Func f) { - Array res; - for(Index i=0; i(&res); + Array data; + T res; + for(Index i = 0; i < data.size(); ++i) + data[i] = f(a[i], b[i]); + std::memcpy(&res, &data, sizeof(T)); + return res; } #define EIGEN_TEST_MAKE_BITWISE2(OP,FUNC,T) \