This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]