This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17173] layout of bitfields with larger-than-int base type
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2004 23:34:06 -0000
- Subject: [Bug c/17173] layout of bitfields with larger-than-int base type
- References: <20040824200144.17173.terra@gnome.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-08-24 23:34 -------
Subject: Re: New: layout of bitfields with larger-than-int base
type
On Tue, 24 Aug 2004, terra at gnome dot org wrote:
> struct Foo1 {
> int : 1;
> unsigned long long int : 0;
> int z;
> };
Note that the documented implementation-defined behavior is that no
implementation-defined bit-field types such as unsigned long long int are
permitted in strictly conforming mode. That said, there is a comment
@c Would it be better to restrict the pedwarn for other types to C90
@c mode and document the other types for C99 mode?
and this may change. However, as the size and alignment of the
addressable storage unit holding bit-fields are unspecified or
implementation-defined, I see no problem with the type of a :0 bit-field
being relevant to the layout. The layout depends on the ABI and the
question of whether this is the correct layout needs to be referred to any
applicable ABI for the target in question.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17173