Skip to content

Commit 6e11c10

Browse files
chris-b1jreback
authored andcommitted
BLD: alias warning in float hashtabl (#18025)
1 parent 8449ffd commit 6e11c10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/_libs/src/klib/khash_python.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <string.h>
12
#include <Python.h>
23

34
#include "khash.h"
@@ -14,7 +15,9 @@
1415
// hash for 64 bit integers.
1516
// GH 13436
1617
khint64_t PANDAS_INLINE asint64(double key) {
17-
return *(khint64_t *)(&key);
18+
khint64_t val;
19+
memcpy(&val, &key, sizeof(double));
20+
return val;
1821
}
1922
#define kh_float64_hash_func(key) (khint32_t)((asint64(key))>>33^(asint64(key))^(asint64(key))<<11)
2023
#define kh_float64_hash_equal(a, b) ((a) == (b) || ((b) != (b) && (a) != (a)))

0 commit comments

Comments
 (0)