From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2056 invoked by alias); 12 Jan 2009 14:26:03 -0000 Received: (qmail 2026 invoked by uid 48); 12 Jan 2009 14:25:55 -0000 Date: Mon, 12 Jan 2009 14:26:00 -0000 Message-ID: <20090112142555.2025.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/38477] [strict-aliasing] warning message contains compiler-generated symbols In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-01/txt/msg01209.txt.bz2 ------- Comment #12 from rguenth at gcc dot gnu dot org 2009-01-12 14:25 ------- 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. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-01-12 14:25:54 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38477