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: Andrew Cagney <ac131313 at redhat dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 5 Aug 2003 14:58:00 -0000
- Subject: Re: symtab/1317: BYTE_BITFIELD never defined, wastes 4 bytes
- Reply-to: Andrew Cagney <ac131313 at redhat dot com>
The following reply was made to PR symtab/1317; it has been noted by GNATS.
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-gnats@sources.redhat.com
Cc:
Subject: Re: symtab/1317: BYTE_BITFIELD never defined, wastes 4 bytes
Date: Tue, 05 Aug 2003 10:48:22 -0400
> /* 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
BTW, for the sake of inter-project consistency, GDB should probably
steal GCC's [sucky] CHAR_BITFIELD and ENUM_BITFIELD macro definitions.
It appears that bitfields work, just not enum bitfields.
Here's the original PR:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=296
+ struct { enum { one, two, three } : 8 } s1;
enum { one, two, three } e : 8?
Andrew