This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

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


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