[PATCH] Fix math.h with -pedantic
Jakub Jelinek
jakub@redhat.com
Wed May 17 02:05:00 GMT 2000
Hi!
If math.h is included in some file which is compiled with -pedantic by gcc
2.95+, one gets an error.
__extension__ helps here.
2000-05-17 Jakub Jelinek <jakub@redhat.com>
* sysdeps/arm/bits/huge_val.h (HUGE_VAL, HUGE_VALF): Add
__extension__ to hexadecimal floating constant notation.
* sysdeps/i386/bits/huge_val.h (HUGE_VAL, HUGE_VALF, HUGE_VALL):
Likewise.
* sysdeps/ieee754/bits/huge_val.h (HUGE_VAL, HUGE_VALF): Likewise.
* sysdeps/m68k/bits/huge_val.h (HUGE_VAL, HUGE_VALF, HUGE_VALL):
Likewise.
* sysdeps/sparc/sparc64/bits/huge_val.h (HUGE_VAL, HUGE_VALF,
HUGE_VALL): Likewise.
* sysdeps/sparc/sparc32/bits/huge_val.h (HUGE_VAL, HUGE_VALF,
HUGE_VALL): Likewise.
(HUGE_VALL): Set to HUGE_VAL on sparc32.
--- libc/sysdeps/arm/bits/huge_val.h.jj Tue Jan 4 17:11:54 2000
+++ libc/sysdeps/arm/bits/huge_val.h Wed May 17 10:43:47 2000
@@ -1,7 +1,7 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
ARM version.
- Copyright (C) 1992, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1992, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@
# if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
# else
@@ -69,7 +69,7 @@ static __huge_val_t __huge_val = { __HUG
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255f)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
# else
--- libc/sysdeps/i386/bits/huge_val.h.jj Tue Jan 4 17:11:55 2000
+++ libc/sysdeps/i386/bits/huge_val.h Wed May 17 10:44:03 2000
@@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for ix86 (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */
#if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
#else
# define __HUGE_VAL_bytes { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
@@ -48,8 +48,8 @@ static __huge_val_t __huge_val = { __HUG
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255f)
-# define HUGE_VALL (0x1.0p32767L)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+# define HUGE_VALL (__extension__ 0x1.0p32767L)
# else
--- libc/sysdeps/ieee754/bits/huge_val.h.jj Tue Jan 4 17:11:56 2000
+++ libc/sysdeps/ieee754/bits/huge_val.h Wed May 17 10:44:25 2000
@@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,7 +30,7 @@
# if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
# else
@@ -68,7 +68,7 @@ static __huge_val_t __huge_val = { __HUG
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255f)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
# else
--- libc/sysdeps/m68k/bits/huge_val.h.jj Tue Jan 4 17:11:56 2000
+++ libc/sysdeps/m68k/bits/huge_val.h Wed May 17 10:44:52 2000
@@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for m68k (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@
# if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
# else
@@ -58,8 +58,8 @@ static union { unsigned char __c[8]; dou
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255f)
-# define HUGE_VALL (0x1.0p32767L)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+# define HUGE_VALL (__extension__ 0x1.0p32767L)
# else
--- libc/sysdeps/sparc/sparc32/fpu/bits/huge_val.h.jj Tue Jan 4 17:11:59 2000
+++ libc/sysdeps/sparc/sparc32/fpu/bits/huge_val.h Wed May 17 10:42:51 2000
@@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@
# if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
# else
@@ -60,8 +60,13 @@ static __huge_val_t __huge_val = { __HUG
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255)
-# define HUGE_VALL (0x1.0p32767)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
+# if __WORDSIZE == 32
+# define HUGE_VALL HUGE_VAL
+# else
+/* Sparc64 uses IEEE 754 128bit long double */
+# define HUGE_VALL (__extension__ 0x1.0p32767L)
+# endif
# else
--- libc/sysdeps/sparc/sparc64/fpu/bits/huge_val.h.jj Tue Jan 4 17:11:59 2000
+++ libc/sysdeps/sparc/sparc64/fpu/bits/huge_val.h Wed May 17 10:42:51 2000
@@ -1,6 +1,6 @@
/* `HUGE_VAL' constants for IEEE 754 machines (where it is infinity).
Used by <stdlib.h> and <math.h> functions for overflow.
- Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@
# if __GNUC_PREREQ(2,95)
-# define HUGE_VAL (0x1.0p2047)
+# define HUGE_VAL (__extension__ 0x1.0p2047)
# else
@@ -60,12 +60,12 @@ static __huge_val_t __huge_val = { __HUG
# if __GNUC_PREREQ(2,95)
-# define HUGE_VALF (0x1.0p255f)
+# define HUGE_VALF (__extension__ 0x1.0p255f)
# if __WORDSIZE == 32
# define HUGE_VALL HUGE_VAL
# else
/* Sparc64 uses IEEE 754 128bit long double */
-# define HUGE_VALL (0x1.0p32767L)
+# define HUGE_VALL (__extension__ 0x1.0p32767L)
# endif
# else
Jakub
More information about the Libc-hacker
mailing list