structure members of packed structures

Alexandre Oliva aoliva@redhat.com
Tue Jul 15 17:19:00 GMT 2003


On Jul 15, 2003, Mark Mitchell <mark@codesourcery.com> wrote:

>> Another question. What about
>> struct __attribute__((packed)) Foo
>> {
>> T m;
>> };
>> 
>> here m happens to fall at an aligned address, and the size of Foo happens
>> to be a multiple of that alignment. Should m be DECL_PACKED or not?

> I say yes.

Does this mean T needs packed ctors, dtor and member functions?  Are
they implicitly generated from the non-packed ones, or must the user
define them explicitly?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Gcc mailing list