This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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  <jakub@redhat.com>

	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]