This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Statement with no effect warning
> Jan Hubicka <jh@suse.cz> writes:
>
> > > In message <20031216160527.GN2199@kam.mff.cuni.cz>, Jan Hubicka writes:
> > > >Ignore the comments about non-checking bootstrap. As I've checked
> > > >Diego's machines did run earlier than I've commited the patch. Hope
> > > >that all the problems are fixed by now.
> > > What I'm far more concerned about is the fact that a patch which didn't
> > > bootstrap was checked into the tree to start with.
> >
> > I see you don't believe, it, but it really did bootstrap. As I pointed
> > out already, it only reproduce on disabled checking bootstrap, while I
> > did bootstrap with checking enabled (the default settings).
>
> Can we fix this? It would be better if it was impossible to write
> code that will build on a compiler with checking enabled but won't
> build on a compiler with checking disabled.
The problem in this case was that checking macro contains function call
that is a side effect preventing "statement with no side effect"
warning.
As I discussed earlier it would be possible to make warning about
ignored results of non-void expressions but it would be dificult to fine
tune on where to warn and where not. I know that some other compilers
and lint checkers do have this feature, what are the experiences with
it?
Otherwise this is principial problem of checking macros I would say.
Honza
>
> --
> - Geoffrey Keating <geoffk@geoffk.org>