This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH]: Add -Wstrict-aliasing
- From: Nathan Sidwell <nathan at acm dot org>
- To: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Tue, 08 Oct 2002 09:48:13 +0100
- Subject: Re: [C PATCH]: Add -Wstrict-aliasing
- References: <3DA1B2F5.9060008@codesourcery.com> <20021008141203.A18736@hg.cs.mu.oz.au>
- Reply-to: nathan at compsci dot bristol dot ac dot uk
Fergus Henderson wrote:
>
> On 07-Oct-2002, Nathan Sidwell <nathan@codesourcery.com> wrote:
> > this adds a -Wstrict-aliasing warning, which is included in -Wall.
>
> I note that if you compile with "-fno-strict-aliasing -Wstrict-aliasing",
> these warnings won't be enabled. That seems a bit unintuitive, and
> contradicts the documentation. Also it makes it impossible to enable
oops, I seem to have deleted the sentance I wrote about that.
> the warnings about these situations without also enabling the optimization.
yes, whilst I understand your wish, this check asks the aliasing
machinery 'do these types alias'. Naturally, with no-strict-aliasing,
they always will.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
The voices in my head told me to say this
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk