This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: f/sta.c:340: warning: dereferencing type-punned pointer willbreak strict-aliasing rules
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Toon Moene <toon at moene dot indiv dot nluug dot nl>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 24 Nov 2002 11:31:40 -0800
- Subject: Re: f/sta.c:340: warning: dereferencing type-punned pointer willbreak strict-aliasing rules
--On Saturday, November 23, 2002 05:26:28 PM +0100 Toon Moene
<toon@moene.indiv.nluug.nl> wrote:
L.S.,
Could someone, with larger knowledge of C, ook into this warning and see
if it is reasonable ?
I think it's a false positive warning, but I think most of the aliasing
warnings are going to have high false positive rates. (Which is why I'm
not a big fan of those warnings...)
The compiler's complaining because the code is casting
struct _ffesta_possible_root_ *
to a:
struct _ffesta_possible_ *
In this case, the warning is particularly silly because the latter is
the prefix portion of the former. (You are doing what we C++ nerds
would call a derived-to-base conversion.)
So, I think the code is OK, even though we warn about it.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com