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

Ito Kazumitsu ito.kazumitsu@hitachi-cable.co.jp
Mon Jun 2 23:03:01 2003


In message "Re: [kaffe] libraries/clib/net/InetAddressImpl.c cannot be compiled on old Linux"
    on 03/06/03, Ito Kazumitsu <ito.kazumitsu@hitachi-cable.co.jp> writes:

> I am afraid few people are complaining about the poor behavior
> of strtod and most people recommend that libc should be updated.
> So please do not spend much time on this matter.

And in this case,  actions should be taken against old Linux's
buggy strtod and not against kaffe.

So I first made a new library containing strtod of NetBSD,
and tried to make kaffe include it.  But for some reason
kaffe would include the old strtod.  So, as the last resort,
I decided to insert the source of new strtod into kaffe's
Double.c.

But now I have found the reason why the new library cannot
be linked.  In /usr/include/stdlib.h,  there is a
part that reads:

| #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); }

"gcc -O2" is used for compiling Double.c,  so strtod was actually
__strtod_internal.

Now I have prepared new __strtod_internal using the new strtod.
And kaffe can use them and works fine.

Thank you.