This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Robust detection of endianness at compile time.
- From: Nick Maclaren <nmm1 at cus dot cam dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Jul 2007 18:59:27 +0100
- Subject: Re: Robust detection of endianness at compile time.
Andrew Haley <aph-gcc@littlepinkcloud.COM> wrote:
>
> AC_C_BIGENDIAN is for integers. As far as I am aware the PDP/ARM
> "middle-endian" problem only applies to floating-point words, and the
> situation for those is far more complex than mere endianness. Not
> every platform supports the IEEE-754 format, and picking apart other
> formats requires special-case programming. Happily, this isn't a
> problem that most people have to solve.
Oh, gosh, yes. But it applies even to systems that support the
IEEE 754 format, if they use it in different ways. In my talks
here, I warn people against importing binary data from a system
that supports denormalised numbers (or infinities or NaNs) to one
that doesn't. That can cause chaos.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679