[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OpenBSD frexpl failure
From: |
Bruno Haible |
Subject: |
Re: OpenBSD frexpl failure |
Date: |
Tue, 11 Dec 2007 12:28:19 +0100 |
User-agent: |
KMail/1.5.4 |
Eric Blake wrote:
> I'm wondering if we should also add a configure-time compile test in
> float_h.m4, which does the sanity check of this untested snippet:
>
> AC_CHECK_SIZEOF([double])
> AC_CHECK_SIZEOF([long double])
> AC_COMPUTE_INT([variable],
> [(SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE)
> == (DBL_MANT_DIG == LDBL_MANT_DIG)], [<float.h>])
This test is not right. You can have
SIZEOF_DOUBLE < SIZEOF_LONG_DOUBLE && DBL_MANT_DIG == LDBL_MANT_DIG
(the FreeBSD 6.1 case that we had recently). You can also have
SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE && DBL_MANT_DIG < LDBL_MANT_DIG
(if a platform's minimum alignment for types is 16 bytes).
You could try to compute LDBL_MANT_DIG through constant expressions in the
compiler, but this is more likely to expose compiler bugs (especially when
cross-compiling) than to help.
Bruno