This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Problem with <math.h> and -D_GNU_SOURCE and GCC 2.95.1
- To: "George T. Talbot" <george@moberg.com>
- Subject: Re: Problem with <math.h> and -D_GNU_SOURCE and GCC 2.95.1
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 24 Aug 1999 07:01:36 +0200
- Cc: libc-alpha@sourceware.cygnus.com
- References: <37C1D02C.973BBA9@moberg.com>
>>>>> George T Talbot writes:
> If I compile a C program with -D_GNU_SOURCE, and I include <math.h>,
> which I'm doing so I can get to some extra features, such as the NAN
> #define, I get the following compilation error:
Should be fixed in glibc 2.2. The current code is:
/* The gcc, version 2.7 or below, has problems with all this inlining
code. So disable it for this version of the compiler. */
# if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
/* Test for negative number. Used in the signbit() macro. */
__MATH_INLINE int
__signbitf (float __x)
{
__extension__ union { float __f; int __i; } __u = { __f: __x };
return __u.__i < 0;
}
__MATH_INLINE int
__signbit (double __x)
{
__extension__ union { double __d; int __i[2]; } __u = { __d: __x };
return __u.__i[1] < 0;
}
__MATH_INLINE int
__signbitl (long double __x)
{
__extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
return (__u.__i[2] & 0x8000) != 0;
}
# endif
#endif
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de