[kaffe] Re: The problem of "Double.c and buggy strtod" is settled

Helmer Krämer hkraemer at freenet.de
Thu Jun 5 03:34:01 PDT 2003


On Thu, 5 Jun 2003 19:15:54 +0900
Ito Kazumitsu <ito.kazumitsu at hitachi-cable.co.jp> wrote:

Hi,
 
> In message "Re: The problem of "Double.c and buggy strtod" is settled"
>     on 03/06/05, Dalibor Topic <robilad at yahoo.com> writes:
> 
> > Attached is a patch that uses strtod.c from libit 0.7 and works for me on
> > i686-linux 2.4. Could you give it a try, and see if it works on linux 2.0 as
> > well?
> 
> I tried the attached strtod.c but it converts 4.9406564584124654418e-324
> to 0.0 setting errno to 34(ERANGE).  So I am afraid it is not usable
> for libraries/clib/native/Double.c.
> 
> $ cat DoubleTest.c
> #include <stdlib.h>
> #include "strtod.c"
> extern int errno;
> 
> int main(int argc, char* argv[]) {
>    double d = strtod(argv[1], NULL);
>    printf("%s %d %40.20e\n",argv[1], errno, d);
> }
> 
> $ cc -o DoubleTest DoubleTest.c -lm
> In file included from DoubleTest.c:2:
> strtod.c:43: warning: `DBL_MAX' redefined
> /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/float.h:63: warning: this is
> the location of the previous definition
> strtod.c:44: warning: `DBL_MIN' redefined
> /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3/include/float.h:54: warning: this is
> the location of the previous definition

does it work if you comment out the #ifdef HAVE_FLOAT_H ... #endif
stuff in replace/strtod.c? It seems to expect a configure check
for float.h, but I couldn't find any check ....

Greetings,
Helmer 




More information about the kaffe mailing list