From c0c49d60cfeff3b2aa801d6598143a073989654a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 31 Aug 2017 16:39:25 +0000 Subject: Simplify NAN definitions. Similar to my patches for HUGE_VAL and INFINITY. this patch eliminates the bits/nan.h headers. __builtin_nanf ("") is used to define NAN for GCC 3.3 and later; the fallback is (0.0f / 0.0f), which is a constant expression for a quiet NaN of type float, but raises a spurious "invalid" exception outside static initializers, which seems the best that can be done purely in standard C. Again, if anyone actually uses a compiler with its own incompatible extension for producing a constant quiet NaN, we can add compiler conditionals. Tested for x86_64. * math/math.h [__USE_ISOC99] (NAN): Define directly here. Do not include . * math/Makefile (headers): Remove bits/nan.h. * bits/nan.h: Remove. * sysdeps/ieee754/bits/nan.h: Likewise. * sysdeps/mips/bits/nan.h: Likewise. --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 904d375f1c..a87a9c4852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2017-08-31 Joseph Myers + * math/math.h [__USE_ISOC99] (NAN): Define directly here. Do not + include . + * math/Makefile (headers): Remove bits/nan.h. + * bits/nan.h: Remove. + * sysdeps/ieee754/bits/nan.h: Likewise. + * sysdeps/mips/bits/nan.h: Likewise. + * math/math.h [__USE_ISOC99] (INFINITY): Define directly here. Do not include . * math/Makefile (headers): Remove bits/inf.h. -- cgit 1.4.1