bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with -pedantic and #include<cmath>, GCC or GLIBC bug?


From: Jakub Jelinek
Subject: Re: Trouble with -pedantic and #include<cmath>, GCC or GLIBC bug?
Date: Tue, 12 Aug 2003 16:10:23 +0200
User-agent: Mutt/1.4i

On Tue, Aug 12, 2003 at 05:32:24PM +0200, Volker Reichelt wrote:
> This is due to line 385 in GLIBC's mathinline.h:
> 
>   return __temp + __value ?: __x
> 
> I'm using glibc 2.2.5, but the line is still present in glibc 2.3.2.
> 
> Since omitting the middle term of a ?: expression is a gcc extension, it's
> a GCC bug. But since the ISO standard forbids it, it's a GLIBC bug. :-(

Red Hat glibc rpm includes this for some years (it makes no difference
on generated code).
Alternatively, __extension__ should be added to shut GCC up.

2000-05-22  Jakub Jelinek  <address@hidden>

        * sysdeps/i386/fpu/bits/mathinline.h (__expm1_code): Avoid using ?:
        with omitted middle operand.

--- libc/sysdeps/i386/fpu/bits/mathinline.h     4 Jun 2003 22:17:35 -0000       
1.1.1.13
+++ libc/sysdeps/i386/fpu/bits/mathinline.h     4 Jun 2003 22:22:36 -0000       
1.11
@@ -381,7 +381,8 @@ __sincosl (long double __x, long double 
     ("fscale                   # 2^int(x * log2(e))\n\t"                     \
      : "=t" (__temp) : "0" (1.0), "u" (__exponent));                         \
   __temp -= 1.0;                                                             \
-  return __temp + __value ?: __x
+  __temp += __value;                                                         \
+  return __temp ? __temp : __x
 __inline_mathcodeNP_ (long double, __expm1l, __x, __expm1_code)
 
 

        Jakub




reply via email to

[Prev in Thread] Current Thread [Next in Thread]