From 7a99c0fb08bf9199a54033ddd92b2755d71d6264 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 15 Mar 2017 11:27:48 +0300 Subject: [PATCH] Fix AO_SIZE_MAX definition (Linux/musl-gcc) (fix commit b1365bd) * src/atomic_ops_malloc.c [SIZE_MAX && !CPPCHECK] (AO_SIZE_MAX): Cast SIZE_MAX to size_t explicitly (to workaround incorrect definition of SIZE_MAX - e.g. it is defined as ~0ULL in musl-tools which is not correct for a 32-bit target). --- src/atomic_ops_malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atomic_ops_malloc.c b/src/atomic_ops_malloc.c index 77faa4e..8f0a274 100644 --- a/src/atomic_ops_malloc.c +++ b/src/atomic_ops_malloc.c @@ -141,7 +141,8 @@ static char *get_mmaped(size_t sz) # include #endif #if defined(SIZE_MAX) && !defined(CPPCHECK) -# define AO_SIZE_MAX SIZE_MAX +# define AO_SIZE_MAX ((size_t)SIZE_MAX) + /* Extra cast to workaround some buggy SIZE_MAX definitions. */ #else # define AO_SIZE_MAX (~(size_t)0) #endif -- 2.50.1