From ca76fb335ae7b3f820beeeed5667950e7489711e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 28 Mar 2025 15:31:53 -0400 Subject: Add compiler guards for GCC directives --- src/stdlib/siphash.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/stdlib/siphash.c') diff --git a/src/stdlib/siphash.c b/src/stdlib/siphash.c index 44e8b6eb..274b3195 100644 --- a/src/stdlib/siphash.c +++ b/src/stdlib/siphash.c @@ -49,13 +49,17 @@ public uint64_t TOMO_HASH_KEY[2] = {23, 42}; // Randomized in tomo_init() PUREFUNC public uint64_t siphash24(const uint8_t *src, size_t src_sz) { siphash sh; if ((uint64_t)src % __alignof__(uint64_t) == 0) { +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" +#endif const uint64_t *in = (uint64_t*)src; /* Find largest src_sz evenly divisible by 8 bytes. */ const ptrdiff_t src_sz_nearest_8bits = ((ptrdiff_t)src_sz >> 3) << 3; const uint64_t *goal = (uint64_t*)(src + src_sz_nearest_8bits); +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif siphashinit(&sh, src_sz); src_sz -= (size_t)src_sz_nearest_8bits; while (in < goal) { -- cgit v1.2.3