From 0151ecd1498a6239c14d18d2ee85b7ba90111d51 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 21 Sep 2016 21:25:35 +0300 Subject: [PATCH] Fix 'shift count >= width of type' compiler warning in GC_SQRT_SIZE_MAX (fix commit 83231d0) (Cherry-pick part of commit b4eb5c1 from 'master' branch.) * malloc.c (GC_SQRT_SIZE_MAX): Change type from unsigned to size_t. --- malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc.c b/malloc.c index 520931a2..adf5cc10 100644 --- a/malloc.c +++ b/malloc.c @@ -425,7 +425,7 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_uncollectable(size_t lb) # define GC_SIZE_MAX (~(size_t)0) # endif -# define GC_SQRT_SIZE_MAX ((1U << (WORDSZ / 2)) - 1) +# define GC_SQRT_SIZE_MAX ((((size_t)1) << (WORDSZ / 2)) - 1) void * calloc(size_t n, size_t lb) { -- 2.40.0