Thread overview
[Issue 20754] Aggregates inherit alignment of its members
Jun 05, 2020
kinke
Jun 05, 2020
kinke
Jun 05, 2020
kinke
Feb 18, 2021
RazvanN
June 05, 2020
https://issues.dlang.org/show_bug.cgi?id=20754

moonlightsentinel@disroot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moonlightsentinel@disroot.o
                   |                            |rg

--- Comment #1 from moonlightsentinel@disroot.org ---
Digger:
commit 7eff206e3b44485652e2214a1a900df9749ea46c
Author: The Dlang Bot <code+dlang-bot@dawg.eu>
Date:   Sun May 28 14:02:47 2017 +0200

dmd: Merge pull request #6754 from kinke/fix17277

https://github.com/dlang/dmd/pull/6754

Fix alignment/size of packed aggregates (issue #17277) merged-on-behalf-of: Daniel Murphy <yebblies@gmail.com>

--
June 05, 2020
https://issues.dlang.org/show_bug.cgi?id=20754

kinke <kinke@gmx.net> changed:

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

--- Comment #2 from kinke <kinke@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.

--
June 05, 2020
https://issues.dlang.org/show_bug.cgi?id=20754

--- Comment #3 from kinke <kinke@gmx.net> ---
(In reply to kinke from comment #2)
> I don't see any violation at all.

Ah sry, I see the faulty spec code example + sentence ('The alignment for the fields of an aggregate does not affect the alignment of the aggregate itself') now.

--
June 05, 2020
https://issues.dlang.org/show_bug.cgi?id=20754

--- Comment #4 from kinke <kinke@gmx.net> ---
https://github.com/dlang/dlang.org/pull/2814

--
February 18, 2021
https://issues.dlang.org/show_bug.cgi?id=20754

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #5 from RazvanN <razvan.nitu1305@gmail.com> ---
The spec was updated so I'm gonna close this issue as WONTFIX.

--