SHA256
1
0
forked from pool/findutils
findutils/LDBL_MAX-gcc4.4.patch

63 lines
2.8 KiB
Diff

| From: Werner Fink <werner@suse.de>
| Date: Mon, 14 Mar 2016 14:20:51 +0000
|
| Is this wrong value of LDBL_MAX still valid got gcc > 4
| Compare with
| https://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00011.html
|
---
gl/lib/float.c | 2 +-
gl/lib/float.in.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- gl/lib/float.c
+++ gl/lib/float.c 2016-03-14 14:29:38.001448470 +0000
@@ -13,21 +13,21 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
/* Specification. */
#include <float.h>
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && (defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4))
const union gl_long_double_union gl_LDBL_MAX =
{ { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
#elif defined __i386__
const union gl_long_double_union gl_LDBL_MAX =
{ { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
typedef int dummy;
#endif
--- gl/lib/float.in.h
+++ gl/lib/float.in.h 2016-03-14 14:15:45.616871084 +0000
@@ -112,21 +112,21 @@ extern const union gl_long_double_union
wrong.
On Linux/PowerPC with gcc 4.4, the value of LDBL_MAX is wrong. */
#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
# undef LDBL_MIN_EXP
# define LDBL_MIN_EXP DBL_MIN_EXP
# undef LDBL_MIN_10_EXP
# define LDBL_MIN_10_EXP DBL_MIN_10_EXP
# undef LDBL_MIN
# define LDBL_MIN 2.22507385850720138309023271733240406422e-308L /* DBL_MIN = 2^-1022 */
#endif
-#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && defined __GNUC__
+#if (defined _ARCH_PPC || defined _POWER) && (defined _AIX || defined __linux__) && (LDBL_MANT_DIG == 106) && (defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4))
# undef LDBL_MAX
/* LDBL_MAX is represented as { 0x7FEFFFFF, 0xFFFFFFFF, 0x7C8FFFFF, 0xFFFFFFFF }.
It is not easy to define:
#define LDBL_MAX 1.79769313486231580793728971405302307166e308L
is too small, whereas
#define LDBL_MAX 1.79769313486231580793728971405302307167e308L
is too large. Apparently a bug in GCC decimal-to-binary conversion.
Also, I can't get values larger than
#define LDBL63 ((long double) (1ULL << 63))
#define LDBL882 (LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63 * LDBL63)