aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2019-12-18 16:37:26 +0100
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2019-12-18 16:37:26 +0100
commit5a3eaf88acbad04194e7e5fad6fe6ba9b3a20748 (patch)
tree02265cde4c869a30cfe5725fa469133a1bfb2edc /test
parentde07c4d1c25d59cb1c0d3cdfed8c0177ada9e4df (diff)
Workaround class-memaccess warnings on newer GCC versions
Diffstat (limited to 'test')
-rw-r--r--test/packetmath.cpp3
1 files changed, 2 insertions, 1 deletions
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<unsigned char*>(&res), &data, sizeof(T));
return res;
}