long double (was "strtold?")

Howland Craig D (Craig) howland@LGSInnovations.com
Mon Apr 20 20:19:00 GMT 2009

The _LDBL_EQ_DBL flag is not for having long double, but that long
is the same size as float; those new names do not sound good for that.
(The names sound more like long double is present or not.)
The need for stdlib.h and math.h to gate the prototypes should only be
temporary, as when the "real" LDBL routines get added they come out of
the gate--which eventually disappears.
One thought is that perhaps to avoid a lot of angst over something that
is only temporary, put the works-only-with-GCC check into config.h.  If
someone wants the benefit with other than GCC, they can manually
define _LDBL_EQ_DBL flag in config.h.
Another thought is that the check should really just be run by
and _LDBL_EQ_DBL gets put into something that configure generates,
as in newlib.h.  (In certain respects this is perhaps best, as it
what the library was built with in case the user has a compiler option
that changes long double size.  I did see that in the forthcoming GCC
4.4 that there seems to be an option for SW FP to use 128 bits vs. a
default smaller size.)

-----Original Message-----
From: Jeff Johnston [mailto:jjohnstn@redhat.com] 
Sent: Monday, April 20, 2009 2:13 PM
To: Ken Werner
Cc: newlib@sourceware.org; Howland Craig D (Craig)
Subject: Re: long double (was "strtold?")

Ken Werner wrote:
> On Saturday 18 April 2009 00:14:13 you wrote:
> Hi,
> Sounds fine for the implementation of the wrapper frunctions but what
> their prototypes? Are you going to include "local.h" from the  math.h
> stdlib.h?
> Ken
My bad...I should have renamed the flag in the headers.  It will now be 
_HAVE_LDBL_MATH for math.h and _HAVE_LDBL_STDLIB  for stdlib.h which for

now have to be manually set per platform (typically via 
libc/include/sys/config.h).  I am open to putting your gcc-specific 
check into libc/include/sys/config.h which would then set the two flags 
automatically, if not already set.

-- Jeff J.

More information about the Newlib mailing list