From d5dc5033d24d98ab19a24686f0a67cad7645c5fb Mon Sep 17 00:00:00 2001 From: Andy Webber Date: Thu, 18 Dec 2014 17:27:59 -0500 Subject: [PATCH] Fixed strict aliasing violation. Changed C-style cast and dereference to std::memcpy. Exactly mirrors other code already in the file. --- include/boost/functional/hash/detail/hash_float.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/functional/hash/detail/hash_float.hpp b/include/boost/functional/hash/detail/hash_float.hpp index ee0ee87..eb9264f 100644 --- a/include/boost/functional/hash/detail/hash_float.hpp +++ b/include/boost/functional/hash/detail/hash_float.hpp @@ -68,7 +68,7 @@ namespace boost std::size_t seed = 0; if (length >= sizeof(std::size_t)) { - seed = *(std::size_t*) ptr; + std::memcpy(&seed, ptr, sizeof(std::size_t)); length -= sizeof(std::size_t); ptr += sizeof(std::size_t);