public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Nathan Sidwell	<nathan@acm.org>, Jason Merrill <jason@redhat.com>,
	Marek Polacek	<polacek@redhat.com>
Subject: Re: [PATCH] Add a -Wcast-align=strict warning
Date: Wed, 13 Sep 2017 17:06:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1709131701160.29579@digraph.polyomino.org.uk> (raw)
In-Reply-To: <AM5PR0701MB26571284440889EF6AFF47B8E4910@AM5PR0701MB2657.eurprd07.prod.outlook.com>

What does this warning do in cases where a type has different alignments 
inside and outside structs?  I'm thinking of something like

struct s { long long x; } *p;
/* ... */
(long long *)p

on 32-bit x86 - where long long's preferred alignment is 8 bytes, but in 
structures it's 4 bytes.  (Likewise for double in place of long long.)  I 
think a warning for a (long long *)p cast might be surprising in that 
case.

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2017-09-13 17:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04  8:07 Bernd Edlinger
2017-09-11 13:53 ` [PING] " Bernd Edlinger
2017-09-13 17:06 ` Joseph Myers [this message]
2017-09-13 19:52   ` Bernd Edlinger
2017-09-13 20:03     ` Joseph Myers
2017-09-13 20:55       ` Bernd Edlinger
2017-09-13 20:57         ` Joseph Myers
2017-09-14 16:33 ` [PATCHv2] " Bernd Edlinger
2017-09-15 15:51   ` Joseph Myers

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=alpine.DEB.2.20.1709131701160.29579@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=nathan@acm.org \
    --cc=polacek@redhat.com \
    /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).