From: Ivan Maidanski Date: Wed, 21 Sep 2016 18:25:35 +0000 (+0300) Subject: Fix 'shift count >= width of type' compiler warning in GC_SQRT_SIZE_MAX X-Git-Tag: v7.6.2~387 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0151ecd;p=gc 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. --- 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) {