This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
enum { BFD_ENDIAN_BIG, ...}
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: binutils at sources dot redhat dot com
- Cc: gdb at sources dot redhat dot com
- Date: Sun, 16 Dec 2001 20:23:37 -0500
- Subject: enum { BFD_ENDIAN_BIG, ...}
Hello,
I'm curious. Why/how did BFD_ENDIAN_BIG come to be first in the enum:
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
This has the (intended?) effect of memset(0) setting a value to
BFD_ENDIAN_BIG where as code using the common host dependant BIG_ENDIAN
/ LITTLE_ENDIAN would have treated such a value as undefined.
GDB, which is trying to eliminate its dependance on those host dependant
macros is suffering minor heart burn as a result of the difference - it
has been assuming that ZERO indicated an uninitialized (roughly
BFD_ENDIAN_UNKNOWN) value.
Andrew