[COMMITTED] Use C99 math macros

Joseph Myers joseph@codesourcery.com
Wed Jun 3 15:57:00 GMT 2015


On Wed, 3 Jun 2015, Wilco Dijkstra wrote:

> > Joseph Myers wrote:
> > On Wed, 3 Jun 2015, Wilco Dijkstra wrote:
> > 
> > > diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-finite.c b/sysdeps/ieee754/ldbl-opt/nldbl-
> > finite.c
> > 
> > > -  return __finite (x);
> > > +  return finite (x);
> > 
> > Are you sure about this change?  "finite", as opposed to isfinite, is a
> > non-type-generic BSD function; I'd expect this to cause the "finite"
> > function name to be used for the call instead of __finite.  (Using
> > isfinite here should be fine.)
> 
> Good catch - that's a typo, I meant isfinite indeed. There are a few 
> other calls to finite so I don't think it causes namespace issues:

I suspect the reason they don't cause namespace issues is that GCC knows 
about this function and inlines it.  But I'm pretty sure there's no good 
reason for just these particular calls to do that; all calls should use 
isfinite, and then we should teach GCC __builtin_isfinite to work by 
bit-manipulation, and use it for the isfinite macro with recent-enough 
GCC.

> [ I guess this file is dead: sysdeps/ieee754/support.c:        if(!finite(x)) return(x); ]

Yes, that file should be removed (subject to testing the removal).

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list