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: Michael Matz <matz at suse dot de>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Mark Mitchell <mark at codesourcery dot com>,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: Tue, 26 Nov 2002 12:52:59 +0100 (CET)
- Subject: Re: f/sta.c:340: warning: dereferencing type-punned pointer willbreak strict-aliasing rules
Hi,
On 25 Nov 2002, Gabriel Dos Reis wrote:
> Right, the warning is really silly in that case. Maybe the
> type-punning detection machinery should be mabe aware of that rule..
> But as you I'm not a big fan of that warning in the first place so it
I just wanted to say that for our package maintainers this warning _is_
usefull. They found already some real problems. But indeed it has too
many obvious false positives like poor-mans derived-to-base conversions,
which happen quite a lot in some packages (wine for instance due to the
err, funny win32 object-oriented-C API).
> will probably end up with low priority in my bucket.
I have no idea about frontends, is there a function which already does a
prefix test on structs?
Hmm, now thinking about this: is the use of prefixes really aliasing safe,
or is that just an gcc extension? After all, the structs _are_ different
types with no releation. (Even if it's a gcc extension we don't want to
warn of course)
Ciao,
Michael.