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:
>
> > 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?
>
> I do not want to get a warning on this code:
>
> #include <stdio.h>
> int main (void) {
> printf("hello, world\n");
> }
>
> :-)
This is what I meant by fine tunning. function calls, auto increments
definitly should not warn. The question is how many other special
cases.
>
> By the way, there's also bug 13325 for tree-ssa and "Statement with no
> effect warning", only it is about too much warnings, maybe if you have
> a look at this you can fix it too...
This seems to be side effect of simplifying memcpy calls during
gimplification. In the case we want to emit warnings during
gimplification process, perhaps we want to make such a busy
simplification later on...
Honza
>
> --
> Falk