This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

[PATCH] Fix i386 bits/mathinline.h with -ansi -pedantic


Hi!

Without this, programs including math.h compiled with -ansi -pedantic don't
compile (?: with omitted middle part gives a warning, while the latter
construct results in error).

2000-05-22  Jakub Jelinek  <jakub@redhat.com>

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

--- libc/sysdeps/i386/fpu/bits/mathinline.h.jj	Tue May  9 13:48:18 2000
+++ libc/sysdeps/i386/fpu/bits/mathinline.h	Mon May 22 16:28:00 2000
@@ -367,7 +367,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)
 
 
@@ -498,7 +499,8 @@ __inline_mathcodeNP (asin, __x, return _
 __inline_mathcodeNP (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), __x))
 
 __inline_mathcode_ (long double, __sgn1l, __x, \
-  union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x };  \
+  __extension__								      \
+  union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x };    \
   __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff;			      \
   __n.__xi[1] = 0x80000000;						      \
   __n.__xi[0] = 0;							      \

	Jakub

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