This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: unused comparison warning (bug 62182)
- From: Arnaud Bienner <arnaud dot bienner at gmail dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Apr 2015 11:14:03 +0200
- Subject: Re: unused comparison warning (bug 62182)
- Authentication-results: sourceware.org; auth=none
- References: <CALZjR+2W2i6H0uBMAQq6MxwwHXrRhP+x65AXwM_HJSQ37oe0qw at mail dot gmail dot com> <20150416084144 dot GG6541 at redhat dot com>
Thanks for your quick feedback :)
2015-04-16 10:41 GMT+02:00 Marek Polacek <polacek@redhat.com>:
> - Do you have a copyright assignment on file? (Not sure if it's needed for
> this particular patch.)
No I don't. Do you think I need one for this patch?
> - We'll need testcases. You should e.g. ensure that the warning
> works with -Wunused-comparison and doesn't show up with -Wno-unused-comparison,
> that casting to void suppresses the warning, etc. You can look into
> gcc/testsuite/gcc.dg.
Sure. I haven't look yet at gcc tests. I first wanted to have some
feedback about this, to be
sure it was worth to spend some time to implement this (i.e. this is a
feature you are interested
in), and that what I did wasn't completely wrong.
For now, I just tested my changes manually, checking that the warning
will not be Wunused-value
but Wunused-comparison when the expression was an "==" equality expression.
I will do the changes you mentioned, and submit a new patch.
> - New options need documenting in invoke.texi. Only mentioning the new
> option is not enough. See e.g. "@item -Wlogical-not-parentheses" paragraph
> for an example.
> - As this is a C/C++ FE warning, please move it from common.opt to
> c-family/c.opt.
> - Could you detail how this patch has been tested?
> - Please adhere to the GNU coding style (though we can sort this out in later
> reviews).
>
> Thanks,
>
> Marek