math.h

Howland Craig D (Craig) howland@LGSInnovations.com
Tue Feb 2 04:36:00 GMT 2010


Newlib had a mistake related to how this was done that was corrected
in 1.18--which is why the behavior has changed from 1.17.
 
If isnanf() really is wanted, the suggested addition of including
<ieeefp.h> is correct.  However, the better correction is to not use
isnanf()--obviating the need to add ieeefp.h--but rather to use the
C99/POSIX isnan() function-like macro, which takes any floating point
type (float or double or long double (ldbl not in Newlib--yet)).  This
should be the most portable method.
 
Craig

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On Behalf Of Søren Holm
Sent: Sunday, January 31, 2010 7:27 PM
To: newlib@sourceware.org
Subject: Re: math.h

Mandag 01 februar 2010 01:08:17 skrev Yaakov (Cygwin/X):
> Careful; <ieeefp.h> disables the isnan and isinf macros (which are
> required by POSIX) and declares them as functions instead.  So <math.h>
> cannot #include <ieeefp.h> in this way.  If you really need these
> functions, I think you'll need to #include <ieeefp.h> in your code
>  directly.

ok. The wierd thing is that the software I'm developing compile nice agains 
newlib 1.1.7 but it fails with missing isnanf against newlib 1.18.

/Søren Holm



More information about the Newlib mailing list