[Issue 20754] Aggregates inherit alignment of its members

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 5 13:38:40 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20754

kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #2 from kinke <kinke at gmx.net> ---
(In reply to Bastiaan Veelo from comment #0)
> which in violation of the specification:
> https://dlang.org/spec/attribute.html#align

I don't see any violation at all. If the aggregate has no explicit alignment,
its natural alignment is the max of its field alignments (that was my fix; it's
not spec'd, but the obvious correct habevior), which in this case is 1, so the
aggregate's alignment is 1 too, and accordingly no useless tail padding is
added.

So S.alignof is 1 since 2.075, and used to be 8 before that (as it was based on
the max field size IIRC - also ignoring field alignments > their size). So this
'issue' is clearly invalid IMO.

--


More information about the Digitalmars-d-bugs mailing list