From 1b5855b59733445585fc8985b8c7e4a44c21a3d7 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 14 Nov 2002 17:06:01 +0000 Subject: Define `Sudden_Underflow' when compiling for the Alpha architecture, mainly to avoid getting a SIGFPE signal sent when calling strtod(3) with certain input. The SIGFPE has been sent because the code was not aware that a Gradual Underflow is handled in software via traps on the Alpha architecture, but is not implemented in our Alpha kernel layer. With `Sudden_Underflow' defined, strtod(3) should not depend on Gradual Underflow and adjust its calculations accordingly, which means that other, more subtle errors than the sending of SIGFPE could be solved by this. Discussed with: bde PR: alpha/12623 PR: alpha/17032 PR: alpha/43567 MFC after: 7 days --- lib/libc/stdlib/strtod.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libc/stdlib') diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c index 62f8f2a..d1a0b21 100644 --- a/lib/libc/stdlib/strtod.c +++ b/lib/libc/stdlib/strtod.c @@ -127,6 +127,9 @@ __FBSDID("$FreeBSD$"); #else #define IEEE_LITTLE_ENDIAN #endif +#if defined(__alpha__) +#define Sudden_Underflow +#endif #endif /* defined(__i386__) ... */ typedef int32_t Long; -- cgit v1.1