public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pluto at agmk dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/38477] [strict-aliasing] warning message contains compiler-generated symbols
Date: Mon, 12 Jan 2009 14:43:00 -0000 [thread overview]
Message-ID: <20090112144327.12653.qmail@sourceware.org> (raw)
In-Reply-To: <bug-38477-16067@http.gcc.gnu.org/bugzilla/>
------- Comment #13 from pluto at agmk dot net 2009-01-12 14:43 -------
(In reply to comment #12)
> This isn't really a warning from system headers:
>
> test.cpp:14: warning: dereferencing pointer '__x.13' does break strict-aliasing
> rules
>
> the location for the dereference is in test.cpp (if that is correct or not
> is another issue). There is at least a bug that we will emit the note: part
> even if the warning was suppressed - I am going to fix that.
>
> I can omit the warning for pointers that are declared in system headers
> in addition to that. Probably this is what is the better behavior - but
> I cannot easily report the dereference location even if it is in a system
> header but the pointer is _not_ from a system header -- which is probably
> what would be wanted here.
>
> So,
>
> t.h:
> #pragma GCC system_header
>
> inline float deref_float (float *p) { return *p; }
>
> t.C:
> #include "t.h"
>
> float transform(int i)
> {
> return deref_float ((float *)&i);
> }
>
> _should_ emit a warning? Even if it looks like
>
> t.h: In function 'float transform(int)':
> t.h:3: warning: dereferencing pointer 'i.0' does break strict-aliasing rules
> t.C:5: note: initialized from here
>
> ?
>
> IMHO we want to warn unless _both_, the declaration and the dereference is
> in a system header.
>
this will be painfull for users, e.g. boost::optional uses so called
aligned_storage via mistic void*/casts/etc and now i'm getting these
warnings from boost-system-headers. in this way, the -isystem switch
is completely useless.
--
pluto at agmk dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38477
next prev parent reply other threads:[~2009-01-12 14:43 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
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 [this message]
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=20090112144327.12653.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).