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]

Re: [Itai Nahshon <nahshon@actcom.co.il>] RedHat-6.0 fails to compile with -ansi -pedantic


>>>>> Ulrich Drepper writes:

Uli> Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
>> Here's again the problematic definition - and a patch to silent 
>> -ansi -pedantic -O2 (but gcc produces worse code with this):
>> __MATH_INLINE int
>> __signbitf (float __x)
>> {
>> -   union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0;
>> +  union { float __f; int __i; } __u; __u.__f = __x; return __u.__i < 0;
>> }

Uli> __extension__ works for me.  Maybe it's a gcc version thing.  But then
Uli> I don't care.  If people want to use pedantic they have to use the
Uli> right gcc version.

I thought I've tried the patch you've made - but it works now for me
with egcs 1.1.2 and gcc-2.95 current.

The only problem is with gcc 2.7.2.3 - it complains about the
extension and gives an internal compiler error :-(.  We should add the 
appended patch to disable the macros.

Please add this to both branches.

Thanks,
Andreas

1999-06-13  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* sysdeps/i386/fpu/bits/mathinline.h: Disable signbit* inline
	functions for gcc <= 2.7.x.

--- sysdeps/i386/fpu/bits/mathinline.h.~1~	Sun Jun 13 20:44:34 1999
+++ sysdeps/i386/fpu/bits/mathinline.h	Sun Jun 13 20:55:41 1999
@@ -110,6 +110,10 @@
 	__result; })
 # endif	/* __i686__ */
 
+/* The gcc, version 2.7 or below, has problems with all this inlining
+   code.  So disable it for this version of the compiler.  */
+# if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
+
 /* Test for negative number.  Used in the signbit() macro.  */
 __MATH_INLINE int
 __signbitf (float __x)
@@ -129,6 +133,7 @@
   __extension__ union { long double __l; int __i[3]; } __u = { __l: __x };
   return (__u.__i[2] & 0x8000) != 0;
 }
+# endif
 #endif
 
 

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

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