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

Ito Kazumitsu ito.kazumitsu at hitachi-cable.co.jp
Fri Jun 6 17:53:01 PDT 2003


Hi Dalibor,

In message "Re: [kaffe] Re: The problem of "Double.c and buggy strtod" is settled"
    on 03/06/06, Dalibor Topic <robilad at yahoo.com> writes:

> Well, on to the next implementation ;) The atatched patch used strtod from
> dietlibc so it would be nice if you could try it out.

Fine.

The new strtod worked almost perfectly with one significant problem.
That is:

We need a modified stdlib.h to be included into Double.c.

--- /usr/include/stdlib.h	Tue Oct 13 18:29:16 1998
+++ libraries/clib/native/stdlib.h	Sat Jun  7 08:56:13 2003
@@ -149,8 +149,10 @@
 #if defined (__OPTIMIZE__) && __GNUC__ >= 2
 /* Define inline functions which call the internal entry points.  */
 
+/*
 extern __inline double strtod (__const char *__nptr, char **__endptr)
 { return __strtod_internal (__nptr, __endptr, 0); }
+*/
 extern __inline long int strtol (__const char *__nptr,
 				 char **__endptr, int __base)
 { return __strtol_internal (__nptr, __endptr, __base, 0); }


If you do not like to modify stdlib.h,  other choices I can think of are:

      - Do not use the optimization flag when compiling.
  or
      - Change the name of strtod in libraries/clib/native/Double.c and
        replace/strtod.c to something like rpl_strtod.




More information about the kaffe mailing list