HUGE_VALF and HUGE_VALL support

Joseph S. Myers joseph@codesourcery.com
Sat Oct 15 09:33:00 GMT 2005


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



More information about the Newlib mailing list