RFC: attribute "unpadded"

Paul Koning pkoning@equallogic.com
Sat Aug 24 14:05:00 GMT 2002


>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> writes:

 Alexandre> Instead of attaching this attribute to the type, perhaps
 Alexandre> it would bring us less complications to attach it to a
 Alexandre> struct member, i.e., instead of:

 >> struct A __attribute__((unpadded)) { void *vptr; char c; }; struct
 >> B { struct A __base; char c2; };

 Alexandre> you'd write:

 >> struct A { void *vptr; char c; }; struct B { struct A __base
 >> __attribute__((unpadded)); char c2; };

 Alexandre> this wouldn't require any change in the typing rules,
 Alexandre> since the type of struct A would be unchanged.

I like that.  The "unpadded" proposal sounded like it would do
significant violence to the C type system, and this avoids that
issue. 

       paul



More information about the Gcc mailing list