aboutsummaryrefslogtreecommitdiff
path: root/bits
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-08-31 16:39:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-08-31 16:39:25 +0000
commitc0c49d60cfeff3b2aa801d6598143a073989654a (patch)
tree248bd1a808a8f2e27396ddfd1c04e5362d7e5da2 /bits
parent5ef1b2138d4236bb3616e612c5bc4dc328a9ffb2 (diff)
downloadglibc-c0c49d60cfeff3b2aa801d6598143a073989654a.zip
glibc-c0c49d60cfeff3b2aa801d6598143a073989654a.tar.gz
glibc-c0c49d60cfeff3b2aa801d6598143a073989654a.tar.bz2
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 <bits/nan.h>. * math/Makefile (headers): Remove bits/nan.h. * bits/nan.h: Remove. * sysdeps/ieee754/bits/nan.h: Likewise. * sysdeps/mips/bits/nan.h: Likewise.
Diffstat (limited to 'bits')
-rw-r--r--bits/nan.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/bits/nan.h b/bits/nan.h
deleted file mode 100644
index ab38168..0000000
--- a/bits/nan.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef _MATH_H
-#error "Never use <bits/nan.h> directly; include <math.h> instead."
-#endif
-
-/* This file should define `NAN' on machines that have such things. */