This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c/17173] layout of bitfields with larger-than-int base type


------- 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


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