From 61f29448ae11f19c934af9781b664ee82edb7938 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 29 Oct 2017 18:27:27 -0500 Subject: [PATCH] BLD: alias warning in float hashtabl --- pandas/_libs/src/klib/khash_python.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/src/klib/khash_python.h b/pandas/_libs/src/klib/khash_python.h index a375a73b04c9e..dd75ae5ec7e28 100644 --- a/pandas/_libs/src/klib/khash_python.h +++ b/pandas/_libs/src/klib/khash_python.h @@ -1,3 +1,4 @@ +#include #include #include "khash.h" @@ -14,7 +15,9 @@ // hash for 64 bit integers. // GH 13436 khint64_t PANDAS_INLINE asint64(double key) { - return *(khint64_t *)(&key); + khint64_t val; + memcpy(&val, &key, sizeof(double)); + return val; } #define kh_float64_hash_func(key) (khint32_t)((asint64(key))>>33^(asint64(key))^(asint64(key))<<11) #define kh_float64_hash_equal(a, b) ((a) == (b) || ((b) != (b) && (a) != (a)))