This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch] BIG_ENDIAN -> BFD_ENDIAN_BIG
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 16 Dec 2001 20:30:33 -0500
- Subject: Re: [patch] BIG_ENDIAN -> BFD_ENDIAN_BIG
- References: <3C1B93A6.3020902@cygnus.com>
Just FYI,
> 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
>