This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] fix c++/27975, add new warning option -Wenum-compare
- From: Ian Lance Taylor <iant at google dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 21 May 2008 15:05:07 -0700
- Subject: Re: [patch] fix c++/27975, add new warning option -Wenum-compare
- References: <Pine.LNX.4.64.0805211807280.20583@wotan.suse.de>
Michael Matz <matz@suse.de> writes:
> the bugreport asks for the possibility to disable the warning about
> comparison of values of different enum types. The request seems
> reasonable and I've put it under the control of a new flag -Wenum-compare
> (only for C++ as only that frontend implements the warning).
>
> Right now it's disabled by default, but we could enable it with -Wall or
> -Wextra, I'll do whatever is decided.
It seems to me that this option was previously always emitted. So I
think that -Wenum-compare should be turned on by -Wall.
Also it would be nice to have some test cases. If you are lucky you
will find an existing test case which used to emit a warning and now
does not.
I'll say OK with -Wall turning on -Wenum-compare and with a test case,
but please give people a day to comment.
Thanks.
Ian