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.4.6~226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cc5f09bfef7e9c3fecd8a2c682bf82806b4fe9b;p=gc Fix 'shift count >= width of type' compiler warning in GC_SQRT_SIZE_MAX (Cherry-pick commit 0151ecd from 'release-7_6' branch.) * malloc.c (GC_SQRT_SIZE_MAX): Change type from unsigned to size_t. --- diff --git a/malloc.c b/malloc.c index 1c2f019d..b8588549 100644 --- a/malloc.c +++ b/malloc.c @@ -407,7 +407,7 @@ void * malloc(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) {