This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: symtab/1317: BYTE_BITFIELD never defined, wastes 4 bytes
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 5 Aug 2003 05:58:01 -0000
- Subject: Re: symtab/1317: BYTE_BITFIELD never defined, wastes 4 bytes
- Reply-to: Michael Elizabeth Chastain <mec at shout dot net>
The following reply was made to PR symtab/1317; it has been noted by GNATS.
From: Michael Elizabeth Chastain <mec@shout.net>
To: ac131313@redhat.com
Cc: gdb-gnats@sources.redhat.com
Subject: Re: symtab/1317: BYTE_BITFIELD never defined, wastes 4 bytes
Date: Tue, 5 Aug 2003 01:51:31 -0400
gcc actually does a gcc-version test for enum bitfields,
rather than an autoconf test.
Zack Weinberg originally did an autoconf test, but he backed off it
because he couldn't be sure that every compiler which claimed to
have enum bitfields would support them properly.
Google on gcc_AC_C_ENUM_BF_UNSIGNED for more history.
So gcc HEAD has this code in system.h:
/* Be conservative and only use enum bitfields with GCC. Likewise for
char bitfields.
FIXME: provide a complete autoconf test for buggy enum bitfields. */
#if (GCC_VERSION > 2000)
#define ENUM_BITFIELD(TYPE) enum TYPE
#define CHAR_BITFIELD unsigned char
#else
#define ENUM_BITFIELD(TYPE) unsigned int
#define CHAR_BITFIELD unsigned int
#endif
In gdb land, we could either just use an autoconf test and go for it,
or we could do like gcc does and test GCC_VERSION (either with or
without an autoconf test).
Michael C