public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Andy Falanga (afalanga)" <afalanga@micron.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Andrew Haley <aph@redhat.com>,
	       "gcc-help@gcc.gnu.org"	<gcc-help@gcc.gnu.org>
Subject: RE: Possible bug in gcc 4.4.7
Date: Thu, 18 Sep 2014 20:40:00 -0000	[thread overview]
Message-ID: <60F6FAE47D1BCE4380CC06D18F49789B93F83098@NTXBOIMBX02.micron.com> (raw)
In-Reply-To: <CAH6eHdT8h4u1J1nrQ=geL=05uWmdSNQSd61sKK-xYHfmFfxL0Q@mail.gmail.com>

> 
> So looking into reinterpret_cast is not very relevant.
> 
> You are using a reference of type unsigned int& to access something
> that is not an unsigned int, that's the problem.
> 
> The fact you used reinterpret_cast to create the reference is not
> relevant, it's what you did with the reference after you created it
> that is the problem. This is undefined in the same way, but doesn't use
> reinterpret_cast:
> 
> Flag f1;
> void* vp = &f1;
> *static_cast<unsigned int*>(vp) = 1;


Ok, thanks.  I think I get it now.

  reply	other threads:[~2014-09-18 20:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 16:17 Andy Falanga (afalanga)
2014-09-17 17:00 ` Jonathan Wakely
2014-09-17 17:15   ` Andy Falanga (afalanga)
2014-09-17 18:05     ` Andrew Haley
2014-09-17 20:34       ` Andy Falanga (afalanga)
2014-09-18  0:12         ` Jonathan Wakely
2014-09-18 14:25           ` Andy Falanga (afalanga)
2014-09-18 17:42             ` Jonathan Wakely
2014-09-18 20:40               ` Andy Falanga (afalanga) [this message]
2014-09-17 23:57     ` 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=60F6FAE47D1BCE4380CC06D18F49789B93F83098@NTXBOIMBX02.micron.com \
    --to=afalanga@micron.com \
    --cc=aph@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.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).