nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 20.03 51 lines 1.7 kB view raw
1From 3bd82a82cf4ba693d2c31c7b95aaec4e56dc92a4 Mon Sep 17 00:00:00 2001 2From: Paul Eggert <eggert@cs.ucla.edu> 3Date: Mon, 11 Mar 2019 16:40:29 -0700 4Subject: [PATCH 1/1] strtod: fix clash with strtold 5 6Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). 7* lib/strtod.c (compute_minus_zero, minus_zero): 8Simplify by remving the macro / external variable, 9and having just a function. User changed. This avoids 10the need for an external variable that might clash. 11--- 12 ChangeLog | 9 +++++++++ 13 lib/strtod.c | 11 +++++------ 14 2 files changed, 14 insertions(+), 6 deletions(-) 15 16diff --git a/lib/strtod.c b/lib/strtod.c 17index b9eaa51..69b1564 100644 18--- a/lib/strtod.c 19+++ b/lib/strtod.c 20@@ -294,16 +294,15 @@ parse_number (const char *nptr, 21 ICC 10.0 has a bug when optimizing the expression -zero. 22 The expression -MIN * MIN does not work when cross-compiling 23 to PowerPC on Mac OS X 10.5. */ 24-#if defined __hpux || defined __sgi || defined __ICC 25 static DOUBLE 26-compute_minus_zero (void) 27+minus_zero (void) 28 { 29+#if defined __hpux || defined __sgi || defined __ICC 30 return -MIN * MIN; 31-} 32-# define minus_zero compute_minus_zero () 33 #else 34-DOUBLE minus_zero = -0.0; 35+ return -0.0; 36 #endif 37+} 38 39 /* Convert NPTR to a DOUBLE. If ENDPTR is not NULL, a pointer to the 40 character after the last one used in the number is put in *ENDPTR. */ 41@@ -479,6 +478,6 @@ STRTOD (const char *nptr, char **endptr) 42 /* Special case -0.0, since at least ICC miscompiles negation. We 43 can't use copysign(), as that drags in -lm on some platforms. */ 44 if (!num && negative) 45- return minus_zero; 46+ return minus_zero (); 47 return negative ? -num : num; 48 } 49-- 501.9.1 51