I still don't understand the align attribute
Stewart Gordon
smjg_1998 at yahoo.com
Thu Jun 17 12:45:45 PDT 2010
Trass3r wrote:
> http://digitalmars.com/d/2.0/attribute.html#align
>
> "align by itself sets it to the default, which matches the default
> member alignment of the companion C compiler."
> OK!
>
> "align(Integer): Integer specifies the alignment which matches the
> behavior of the companion C compiler when non-default alignments are used"
> I don't really understand that sentence.
<snip>
Basically, it means that the member is aligned on n-byte boundaries in
whatever way the companion C compiler does if instructed to.
However, there's no statement I can find of what's supposed to happen if
the companion C compiler doesn't support alignment control at the level
where it is used.
http://d.puremagic.com/issues/show_bug.cgi?id=3183
(marked as fixed, but it seems it isn't really)
http://www.digitalmars.com/d/archives/digitalmars/D/Spec_of_align_attribute_is_a_mess_88129.html
Stewart.
More information about the Digitalmars-d-learn
mailing list