Aw: Re: asking for __attribute__((aligned()) clarification
"Markus Fröschle"
markus@mubf.de
Tue Aug 20 05:46:00 GMT 2019
Thank you (and others) for your answers. Now I'm just as smart as before, however.
Is it a supported, documented, 'long term' feature we can rely on or not?
If yes, I would expect it to be properly documented. If not, never mind.
> Gesendet: Montag, 19. August 2019 um 16:08 Uhr
> Von: "Alexander Monakov" <amonakov@ispras.ru>
> An: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>
> Cc: "Paul Koning" <paulkoning@comcast.net>, "Markus Fröschle" <markus@mubf.de>, gcc@gcc.gnu.org
> Betreff: Re: asking for __attribute__((aligned()) clarification
>
> On Mon, 19 Aug 2019, Richard Earnshaw (lists) wrote:
>
> > Correct, but note that you can only pack structs and unions, not basic types.
> > there is no way of under-aligning a basic type except by wrapping it in a
> > struct.
>
> I don't think that's true. In GCC-9 the doc for 'aligned' attribute has been
> significantly revised, and now ends with
>
> When used as part of a typedef, the aligned attribute can both increase and
> decrease alignment, and specifying the packed attribute generates a warning.
>
> (but I'm sure defacto behavior of accepting and honoring reduced alignment on
> a typedef'ed scalar type goes way earlier than gcc-9)
>
> Alexander
>
More information about the Gcc
mailing list