This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: HUGE_VALF and HUGE_VALL support
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jeff Johnston <jjohnstn at redhat dot com>
- Cc: newlib at sources dot redhat dot com, corinna at sources dot redhat dot com
- Date: Fri, 14 Oct 2005 23:38:39 +0000 (UTC)
- Subject: Re: HUGE_VALF and HUGE_VALL support
- References: <435022D8.8070603@redhat.com>
On Fri, 14 Oct 2005, Jeff Johnston wrote:
> I mentioned a while back that I would take a crack at adding these values to
> newlib. I have had some code kicking around for a while that was getting in
> the way of some recent posted changes so I just checked it in. It has been
> built and tested on i686-pc-linux-gnu.
For GCC >= 3.3 I'd recommend using
# define HUGE_VAL (__builtin_huge_val())
# define HUGE_VALF (__builtin_huge_valf())
# define HUGE_VALL (__builtin_huge_vall())
(as used by glibc) which are usable in static initializers as required by
the C standard (unlike any version using constant variables).
--
Joseph S. Myers
joseph@codesourcery.com