[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils 6.9.92 fail to configure on *bsd
From: |
Bruno Haible |
Subject: |
Re: coreutils 6.9.92 fail to configure on *bsd |
Date: |
Wed, 16 Jan 2008 00:25:51 +0100 |
User-agent: |
KMail/1.5.4 |
Elias Pipping wrote:
> On a sidenote... looking at the first couple of lines in the float.h
> that i attached to that last mail:
>
> /* This file exists soley to keep Metrowerks' compilers happy. The version
> used by GCC can be found in /usr/lib/gcc, although it's
> not very informative. */
>
> It might make sense to attach this file
>
> /usr/lib/gcc/i686-apple-darwin9/4.0.1/include/float.h
>
> as well. So I did.
Thanks. Yes, that file is the one that used by gcc. But it only contains
placeholders that refer to compiler internals, so it is of no use when I
wanted to know the precise values. You already sent me the values produced
by printf statements, that's what I needed.
> % gcc foo.c
> % ./a.out
> -16384 0.5
Thanks, that's the testimony that the system frexpl() is working incorrectly.
I apply this workaround to gnulib:
2008-01-15 Bruno Haible <address@hidden>
Work around a MacOS X 10.5 bug in frexpl().
* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Also check denormalized numbers.
* doc/functions/frexpl.texi: Document the bug.
Reported by Elias Pipping <address@hidden>.
*** doc/functions/frexpl.texi.orig 2008-01-16 00:20:47.000000000 +0100
--- doc/functions/frexpl.texi 2008-01-16 00:10:15.000000000 +0100
***************
*** 15,20 ****
--- 15,23 ----
This function does not work on finite numbers on some platforms:
MacOS X 10.4/PowerPC, AIX 5.1, BeOS.
@item
+ This function does not work on denormalized numbers on some platforms:
+ MacOS X 10.5/i386.
+ @item
This function does not work on infinite numbers on some platforms:
IRIX 6.5, mingw.
@end itemize
*** m4/frexpl.m4.orig 2008-01-16 00:20:47.000000000 +0100
--- m4/frexpl.m4 2008-01-16 00:20:39.000000000 +0100
***************
*** 1,5 ****
! # frexpl.m4 serial 6
! dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
--- 1,5 ----
! # frexpl.m4 serial 7
! dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
***************
*** 96,103 ****
])
dnl Test whether frexpl() works on finite numbers (this fails on
! dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS) and also on infinite
numbers
! dnl (this fails e.g. on IRIX 6.5 and mingw).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
--- 96,104 ----
])
dnl Test whether frexpl() works on finite numbers (this fails on
! dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
! dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this
! dnl fails e.g. on IRIX 6.5 and mingw).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
***************
*** 144,149 ****
--- 145,165 ----
return 1;
}
}
+ /* Test on denormalized numbers. */
+ {
+ int i;
+ for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
+ ;
+ if (x > 0.0L)
+ {
+ int exp;
+ long double y = frexpl (x, &exp);
+ /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
+ exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */
+ if (exp != LDBL_MIN_EXP - 1)
+ return 1;
+ }
+ }
/* Test on infinite numbers. */
x = 1.0L / 0.0L;
{
Re: coreutils 6.9.92 fail to configure on *bsd, Elias Pipping, 2008/01/13