From 5b0e73281fd4d98b6f211cdd1b6b29453c3e420e Mon Sep 17 00:00:00 2001 From: dc Date: Thu, 28 Oct 2021 22:43:21 +0100 Subject: [PATCH] fix spurious build warning with overflow builtins --- include/mimalloc-internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h index 0563d3de..982928cb 100644 --- a/include/mimalloc-internal.h +++ b/include/mimalloc-internal.h @@ -247,11 +247,11 @@ static inline bool mi_malloc_satisfies_alignment(size_t alignment, size_t size) #endif static inline bool mi_mul_overflow(size_t count, size_t size, size_t* total) { #if (SIZE_MAX == ULONG_MAX) - return __builtin_umull_overflow(count, size, total); + return __builtin_umull_overflow(count, size, (unsigned long *)total); #elif (SIZE_MAX == UINT_MAX) - return __builtin_umul_overflow(count, size, total); + return __builtin_umul_overflow(count, size, (unsigned int *)total); #else - return __builtin_umulll_overflow(count, size, total); + return __builtin_umulll_overflow(count, size, (unsigned long long *)total); #endif } #else /* __builtin_umul_overflow is unavailable */