From 606066b8d539d1bcc237f18859403eea002e700d Mon Sep 17 00:00:00 2001 From: haochengxia Date: Sat, 7 Nov 2026 18:02:53 -0600 Subject: [PATCH] fix(hash): mark unaligned reads may_alias in xxhash --- libCacheSim/dataStructure/hash/xxhash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libCacheSim/dataStructure/hash/xxhash.h b/libCacheSim/dataStructure/hash/xxhash.h index 0d1820aa5..be000f1e4 100644 --- a/libCacheSim/dataStructure/hash/xxhash.h +++ b/libCacheSim/dataStructure/hash/xxhash.h @@ -1063,7 +1063,7 @@ typedef union { static xxh_u32 XXH_read32(const void* ptr) { typedef union { xxh_u32 u32; - } __attribute__((packed)) xxh_unalign; + } __attribute__((packed, __may_alias__)) xxh_unalign; return ((const xxh_unalign*)ptr)->u32; } @@ -1682,7 +1682,7 @@ static xxh_u64 XXH_read64(const void* ptr) { typedef union { xxh_u32 u32; xxh_u64 u64; - } __attribute__((packed)) xxh_unalign64; + } __attribute__((packed, __may_alias__)) xxh_unalign64; return ((const xxh_unalign64*)ptr)->u64; }