From 34e50bccfcf64bb31358f4fa4b220de71f5bae06 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 30 Jan 2019 15:39:53 +0100 Subject: erts: Fix compiler warning for IS_SSMALL "shift count negative or too big, undefined behavior" --- erts/emulator/beam/big.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/big.h b/erts/emulator/beam/big.h index 6e6d7b5a4b..274482a0d2 100644 --- a/erts/emulator/beam/big.h +++ b/erts/emulator/beam/big.h @@ -81,7 +81,11 @@ typedef Uint dsize_t; /* Vector size type */ * a Uint64 argument. Therefore, we must test the size of the argument * to ensure that the cast does not discard the high-order 32 bits. */ -#define _IS_SSMALL32(x) (((Uint32) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) +#if defined(ARCH_32) +# define _IS_SSMALL32(x) (((Uint32) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) +#else +# define _IS_SSMALL32(x) (1) +#endif #define _IS_SSMALL64(x) (((Uint64) ((((x)) >> (SMALL_BITS-1)) + 1)) < 2) #define IS_SSMALL(x) (sizeof(x) == sizeof(Uint32) ? _IS_SSMALL32(x) : _IS_SSMALL64(x)) -- cgit v1.2.3