public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo dot carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/38477] [strict-aliasing] warning message contains compiler-generated symbols
Date: Fri, 12 Dec 2008 11:54:00 -0000	[thread overview]
Message-ID: <20081212115300.5574.qmail@sourceware.org> (raw)
In-Reply-To: <bug-38477-16067@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from paolo dot carlini at oracle dot com  2008-12-12 11:53 -------
(In reply to comment #6)
> But there is no space for _Rb_tree_node<_Val> in ctx.foo._M_t._M_impl.
> 
>         struct _Rb_tree_impl : public _Node_allocator
>         {
>           _Key_compare          _M_key_compare;
>           _Rb_tree_node_base    _M_header;
>           size_type             _M_node_count;

This has nothing to do with the allocated nodes.

> 
> the _M_header member is of type _Rb_tree_node_base, so I don't see how you
> can cast that to _Rb_tree_node<_Val> and expect the _M_value_field to magically
> appear in memory.

Hey Richard, don't tell me it's the first time you see production code casting
a pointer from base to derived and accessing a member existing only in the
derived type. Indeed, the HP / SGI STL people did that, not the worse
programmers in the world ;) Anyway, if you think this is something wrong from
the aliasing specifications point of view, please point me to the relevant
sections of the Standard, let's work this out, is going to be painful and
risky, I'm afraid...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38477


  parent reply	other threads:[~2008-12-12 11:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-10 17:17 [Bug c++/38477] New: " dimhen at gmail dot com
2008-12-10 17:40 ` [Bug libstdc++/38477] " rguenth at gcc dot gnu dot org
2008-12-10 17:46 ` rguenth at gcc dot gnu dot org
2008-12-12 11:11 ` paolo dot carlini at oracle dot com
2008-12-12 11:25 ` rguenth at gcc dot gnu dot org
2008-12-12 11:40 ` paolo dot carlini at oracle dot com
2008-12-12 11:45 ` rguenth at gcc dot gnu dot org
2008-12-12 11:54 ` paolo dot carlini at oracle dot com [this message]
2008-12-12 11:58 ` rguenth at gcc dot gnu dot org
2008-12-12 12:10 ` rguenth at gcc dot gnu dot org
2009-01-05 23:47 ` bkoz at gcc dot gnu dot org
2009-01-06 19:45 ` rguenth at gcc dot gnu dot org
2009-01-12 14:26 ` rguenth at gcc dot gnu dot org
2009-01-12 14:43 ` pluto at agmk dot net
2009-01-12 14:52 ` rguenth at gcc dot gnu dot org
2009-01-13 11:03 ` rguenth at gcc dot gnu dot org
2009-01-13 12:14 ` rguenth at gcc dot gnu dot org
2009-01-14 16:45 ` [Bug middle-end/38477] " rguenth at gcc dot gnu dot org
2009-01-14 16:47 ` rguenth at gcc dot gnu dot org

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=20081212115300.5574.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).