public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "Andy Falanga (afalanga)" <afalanga@micron.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 00:12:00 -0000	[thread overview]
Message-ID: <CAH6eHdTxe0z0kOgnpsx+dUVFe3ugk9HH4oNwcWOJKr2XcQZKTw@mail.gmail.com> (raw)
In-Reply-To: <60F6FAE47D1BCE4380CC06D18F49789B93F81D6D@NTXBOIMBX02.micron.com>

On 17 September 2014 21:34, Andy Falanga (afalanga) wrote:
> Thank you for the reference.  I'm going to have to think on this for a bit.  I read a bit of the definition for reinterpret_cast in the C++ Draft I have too.  I want to figure this out for sure.

I think you're barking up the wrong tree if you're trying to
understand when reinterpret_cast is suitable ... because it is almost
never a good idea!  reinterpret_cast basically means "just shut up and
do this cast, I know what I'm doing", but that means you've lost the
advantages of having the compiler do type checking.

The rules Andrew quoted say when it's OK to violate the language's
type system. If you try to break those rules you can use
reinterpret_cast to make the compiler shut up and do what it's told,
but you're still breaking the rules.

  reply	other threads:[~2014-09-18  0:12 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 [this message]
2014-09-18 14:25           ` Andy Falanga (afalanga)
2014-09-18 17:42             ` Jonathan Wakely
2014-09-18 20:40               ` Andy Falanga (afalanga)
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=CAH6eHdTxe0z0kOgnpsx+dUVFe3ugk9HH4oNwcWOJKr2XcQZKTw@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=afalanga@micron.com \
    --cc=aph@redhat.com \
    --cc=gcc-help@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).