This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: Fix enum comparisons
"Manuel LÃpez-IbÃÃez" <lopezibanez@gmail.com> writes:
> @@ -409,6 +409,11 @@
> can turn it off only if it's not explicit. */
> if (warn_main == -1)
> warn_main = (value ? 2 : 0);
> +
> + /* In C, -Wall turns on -Wenum-compare, which we do here.
> + In C++ it is on by default, which is done in
> + c_common_post_options. */
> + warn_enum_compare = value;
> }
> else
> {
>
>
> This will make -Wno-enum-compare -Wall enable -Wenum-compare. Is that
> what you want? I know some of the flags *do* behave like this but we
> are slowly fixing them.
I don't have a particular opinion. I guess it should be
if (warn_enum_compare == -1)
warn_enum_compare = value;
?
Ian