Re: [PATCH] strtod: make it more-accurate typically, and don't require libm

2010-07-13 Thread Bruno Haible
Hi Paul, > but won't the "return 0.0" cause some compilers to > issue bogus warnings about X and EXPONENT not being used? > That's why I had the "x + exponent" in there. We have a macro for this purpose in gnulib (actually, even two): _GL_UNUSED and _UNUSED_PARAMETER_. Alternatively, a cast to vo

Re: [PATCH] strtod: make it more-accurate typically, and don't require libm

2010-07-12 Thread Paul Eggert
> - static double ldexp (double x, int exponent) { return x + exponent; } > + /* A dummy definition that will never be invoked. */ > + static double ldexp (double x, int exponent) { abort (); return 0.0; } The comment and "abort" are fine of course, but won't the "return 0.0" cause some compilers

Re: [PATCH] strtod: make it more-accurate typically, and don't require libm

2010-07-12 Thread Bruno Haible
Hi Paul, Paul Eggert wrote: > + #define ldexp dummy_ldexp > + static double ldexp (double x, int exponent) { return x + exponent; } This code looks fishy to someone who may not understand the intent of this definition. How about making it clearer, like this? --- lib/strtod.c.orig Mon Jul 12 2

Re: [PATCH] strtod: make it more-accurate typically, and don't require libm

2010-07-12 Thread Bruno Haible
Paul Eggert wrote: > +# FIXME: This implementation is a copy of printf-frexp.m4 and should be > shared. Indeed, it's bad for maintenance to have several macros which set the same autoconf cache variable, as they can easily evolve differently. I'm fixing these 4 occurrences: 2010-07-12 Bruno Ha

[PATCH] strtod: make it more-accurate typically, and don't require libm

2010-07-12 Thread Paul Eggert
rtod_l) so all this work is for somebody else. Ah well >From 76ca2dc4900fc8b0aa37d38e5a19fa2242f3a3c6 Mon Sep 17 00:00:00 2001 From: Paul R. Eggert Date: Mon, 12 Jul 2010 09:14:10 -0700 Subject: [PATCH] strtod: make it more-accurate typically, and don't require libm * lib/strtod.