This is the mail archive of the
mailing list for the GCC project.
Re: asking for __attribute__((aligned()) clarification
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>
- Cc: Paul Koning <paulkoning at comcast dot net>, Markus Fröschle <markus at mubf dot de>, gcc at gcc dot gnu dot org
- Date: Mon, 19 Aug 2019 17:08:48 +0300 (MSK)
- Subject: Re: asking for __attribute__((aligned()) clarification
- References: <trinity-81dd3866-fe32-4da3-9727-47945a6dc667-1566218760407@3c-app-1and1-bs05> <1E465204-0887-49CB-8472-196EDE7AAE81@comcast.net> <email@example.com>
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
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)