This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
__IEEE_*_ENDIAN vs. BYTE_ORDER
- From: Ralf Corsepius <corsepiu at faw dot uni-ulm dot de>
- To: Newlib List <newlib at sources dot redhat dot com>
- Date: Wed, 28 Apr 2004 15:40:00 +0200
- Subject: __IEEE_*_ENDIAN vs. BYTE_ORDER
Hi,
Newlib's sys/param.h applies __IEEE_*_ENDIAN (from machine/ieeefp.h) to
define BYTE_ORDER.
AFAIU, __IEEE_*_ENDIAN denotes the floating point endianess, only, which
doesn't necessarily match with a CPU's general endianess.
E.g. some arm-CPUs seem to use __IEEE_BIG_ENDIAN, while actually being
little endian targets.
On these targets newlib's sys/param.h results into
#define __IEEE_BIG_ENDIAN
#define BYTE_ORDER BIG_ENDIAN
even for little endian arm targets, while I think
#define __IEEE_BIG_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
would have been correct.
I.e. I suspect newlib's sys/param.h to be "illegally" using
__IEEE_*_ENDIAN to setup BYTE_ORDER. I am wrong or right?
Ralf