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