[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] errors: change output, and improve -y coherence
From: |
Akim Demaille |
Subject: |
Re: [PATCH 2/3] errors: change output, and improve -y coherence |
Date: |
Thu, 27 Sep 2012 11:07:02 +0200 |
Hi!
Nice work,
Le 27 sept. 2012 à 12:52, Theophile Ranquet a écrit :
> diff --git a/doc/bison.texi b/doc/bison.texi
> index 1297a36..60dc25f 100644
> --- a/doc/bison.texi
> +++ b/doc/bison.texi
> @@ -9263,12 +9263,34 @@ All the warnings.
> @item none
> Turn off all the warnings.
> @item error
> -Treat warnings as errors.
> +See @option{-Werror}, below.
> @end table
>
> A category can be turned off by prefixing its name with @samp{no-}. For
> instance, @option{-Wno-yacc} will hide the warnings about
> POSIX Yacc incompatibilities.
> +
> address@hidden address@hidden
> address@hidden address@hidden
> +Enable warnings falling in @var{category}, and treat them as errors. If no
> address@hidden is given, it defaults to making all enabled warnings into
> errors.
> +
> address@hidden is the same as for @option{--warnings}, with the exception that
> +it may not be prefixed with @samp{no-} (see above).
> +
> +Prefixed with @samp{no}, it deactivates the error treatment for this
> address@hidden However, the warning itself won't be disabled, or enabled, by
> +this option.
> +
> +Note that the precedence of the '=' and ',' operators is such that the
This should be @samp{=} and @samp{,}.
> +following commands are *not* equivalent, as the first will not treat S/R
@emph{not}
> +conflicts as errors.
> +
> address@hidden
> +$ bison -Werror=yacc,conflicts-sr input.y
> +$ bison -Werror=yacc,error=conflicts-sr input.y
> address@hidden example
> +
Spurious empty line.
> diff --git a/src/getargs.c b/src/getargs.c
> index 90b2655..695ad12 100644
> --- a/src/getargs.c
> +++ b/src/getargs.c
> @@ -87,7 +87,7 @@ flags_argmatch (const char *option,
> args = strtok (args, ",");
> while (args)
> {
> - int value = all;
> + int value = 0;
> int *save_flags = flags;
> int no = STRPREFIX_LIT ("no-", args) ? 3 : 0;
> int err = STRPREFIX_LIT ("error", args + no) ? 5 : 0;
Could you check if having a flag_argmatch function
called from flags_argmatch (which would handle the loop)
wouldn't make things simpler? In later patch.
> @@ -99,7 +99,12 @@ flags_argmatch (const char *option,
>
> if (!value)
> {
> - if (no)
> + /* With a simpler 'if (no)' version, -Werror means -Werror=all