From 184ef36f85d66583306413727fc5f39557d391e4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 22 Aug 2018 19:11:58 -0400 Subject: [PATCH] fix FP_ILOGB0 and FP_ILOGBNAN definitions to be valid for use in #if MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit commit 98c9af500125df41fdb46d7e384b00982d72493a wrongly claimed they do not need to be valid for such usage, but the last sentence of C11 7.1.4 ¶1 imposes a broad requirement that all macros specified as integer constant expressions also need to be valid for #if. simply write the value out explicitly. there is no value here in pretending that the width of int will vary. --- include/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/math.h b/include/math.h index 6ac91da2..fea34686 100644 --- a/include/math.h +++ b/include/math.h @@ -27,7 +27,7 @@ extern "C" { #define MATH_ERREXCEPT 2 #define math_errhandling 2 -#define FP_ILOGBNAN (-1-(int)(((unsigned)-1)>>1)) +#define FP_ILOGBNAN (-1-0x7fffffff) #define FP_ILOGB0 FP_ILOGBNAN #define FP_NAN 0 -- 2.25.1