PATCH RFC: Fix enum comparisons

Ian Lance Taylor iant@google.com
Thu Sep 4 20:50:00 GMT 2008


"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



More information about the Fortran mailing list