bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenBSD frexpl failure


From: Eric Blake
Subject: Re: OpenBSD frexpl failure
Date: Tue, 11 Dec 2007 07:38:35 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 12/11/2007 4:28 AM:
> 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

Do any of the LDBL_* constants on FreeBSD 6.1 differ from their DBL_
counterparts?  In other words, by testing all of the integral DBL vs LDBL
constants, instead of just MANT_DIG, are we less likely to run into these
problems?

>    SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE && DBL_MANT_DIG < LDBL_MANT_DIG
> (if a platform's minimum alignment for types is 16 bytes).

I guess you are right that this is a possibility.

> 
> 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.

It's a bummer that C doesn't permit much floating point in integral
constant expressions, since autoconf's compile-time checking generally
relies on integral constants.  And yes, I agree that trying arithmetic
constant expressions is too risky, since C99 states that although floating
point is allowed, it only has to be evaluated with precision and range at
least as great as if it were evaluated in the execution environment,
rather than requiring strict answers the way Java does.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHXqDl84KuGfSFAYARAibyAKDE3TyOREQl2dH6uQ3HMoJ+e88dugCfaQMK
AqkB79MU0LJYrWdTiRo9M+E=
=netm
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]