From: Daniel Jacobowitz <drow@mvista.com>
To: Dale Johannesen <dalej@apple.com>
Cc: Aldy Hernandez <aldyh@redhat.com>, gcc@gcc.gnu.org
Subject: Re: subreg question
Date: Thu, 13 Dec 2001 13:33:00 -0000 [thread overview]
Message-ID: <20011213162855.A7015@nevyn.them.org> (raw)
In-Reply-To: <EEBA8D7B-F00C-11D5-86F6-003065C86F94@apple.com>
On Thu, Dec 13, 2001 at 01:04:01PM -0800, Dale Johannesen wrote:
>
> On Thursday, December 13, 2001, at 12:43 PM, Daniel Jacobowitz wrote:
> >>>>
> >>>>I don't see why not. (C89) 3.3.4 says the cast might produce an
> >>>>invalid
> >>>>pointer if it's not aligned properly, which is not the case here.
> >>>>Other than that I don't find any relevant restriction in the standard.
> >>>>What did you have in mind?
> >>>>(FWIW, gcc doesn't warn about this even with -pedantic.)
> >>>
> >>>It's not an invalid pointer. It doesn't alias with Z, though.
> >>
> >>Why not?
> >
> >The C standard's aliasing rules. *((float *)&z) is an object of type
> >float; double is a different type than float; z is an object of type
> >double; *((float *)&z) and z can not alias.
>
> Can you point me to someplace in the standard that says this?
Sorry, I don't have a copy. It should be described along with the rest
of the aliasing rules, where that may be.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2001-12-13 21:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-12 18:13 Dale Johannesen
2001-12-13 1:39 ` Jan Hubicka
2001-12-13 10:33 ` Aldy Hernandez
2001-12-13 12:26 ` Dale Johannesen
2001-12-13 12:39 ` Daniel Jacobowitz
2001-12-13 12:45 ` Dale Johannesen
2001-12-13 12:51 ` Daniel Jacobowitz
2001-12-13 13:04 ` Dale Johannesen
2001-12-13 13:33 ` Daniel Jacobowitz [this message]
2001-12-13 13:34 ` Aldy Hernandez
2001-12-13 14:56 ` Richard Henderson
2001-12-13 13:04 ` Aldy Hernandez
2001-12-13 14:57 ` Joe Buck
2008-03-25 14:56 Jan Hoogerbrugge
2008-03-25 15:58 ` Paul Brook
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=20011213162855.A7015@nevyn.them.org \
--to=drow@mvista.com \
--cc=aldyh@redhat.com \
--cc=dalej@apple.com \
--cc=gcc@gcc.gnu.org \
/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).