public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: "Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>,
	"Markus Fröschle" <markus@mubf.de>,
	gcc@gcc.gnu.org
Subject: Re: asking for __attribute__((aligned()) clarification
Date: Mon, 19 Aug 2019 14:12:00 -0000	[thread overview]
Message-ID: <C437F8A7-19F6-439F-A01F-C1207A8A3588@comcast.net> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1908191706100.32047@monopod.intra.ispras.ru>



> On Aug 19, 2019, at 10:08 AM, Alexander Monakov <amonakov@ispras.ru> wrote:
> 
> 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)

Interesting.  It certainly wasn't that way a decade ago.  And for the old code pattern to generate a warning seems like a bad incompatible change.  Honoring reducing alignments is one thing, complaining about packed is not good.

	paul

  reply	other threads:[~2019-08-19 14:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 12:46 "Markus Fröschle"
2019-08-19 13:57 ` Paul Koning
2019-08-19 14:01   ` Richard Earnshaw (lists)
2019-08-19 14:08     ` Alexander Monakov
2019-08-19 14:12       ` Paul Koning [this message]
2019-08-20  5:46       ` Aw: " "Markus Fröschle"
2019-08-21 14:29         ` Alexander Monakov
2019-08-21 14:32           ` Paul Koning
2019-08-21 14:58             ` Alexander Monakov
2019-08-21 16:50               ` Paul Koning
2019-08-21 17:35                 ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C437F8A7-19F6-439F-A01F-C1207A8A3588@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=Richard.Earnshaw@arm.com \
    --cc=amonakov@ispras.ru \
    --cc=gcc@gcc.gnu.org \
    --cc=markus@mubf.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).