From dff7454371003ddce2d6b07d940f965c896d8b81 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 6 Apr 2019 09:32:10 +0200 Subject: [PATCH] doc: sort the warning categories * doc/bison.texi, src/getargs.c: here. --- doc/bison.texi | 40 ++++++++++++++++++++-------------------- src/getargs.c | 4 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/bison.texi b/doc/bison.texi index 0531c526..41e75d28 100644 --- a/doc/bison.texi +++ b/doc/bison.texi @@ -10349,6 +10349,23 @@ is specified. Output warnings falling in @var{category}. @var{category} can be one of: @table @code +@item conflicts-sr +@itemx conflicts-rr +S/R and R/R conflicts. These warnings are enabled by default. However, if +the @code{%expect} or @code{%expect-rr} directive is specified, an +unexpected number of conflicts is an error, and an expected number of +conflicts is not reported, so @option{-W} and @option{--warning} then have +no effect on the conflict report. + +@item deprecated +Deprecated constructs whose support will be removed in future versions of +Bison. + +@item empty-rule +Empty rules without @code{%empty}. @xref{Empty Rules}. Disabled by +default, but enabled by uses of @code{%empty}, unless +@option{-Wno-empty-rule} was specified. + @item midrule-values Warn about midrule values that are set but not used within any of the actions of the parent rule. @@ -10369,26 +10386,6 @@ These warnings are not enabled by default since they sometimes prove to be false alarms in existing grammars employing the Yacc constructs @code{$0} or @code{$-@var{n}} (where @var{n} is some positive integer). -@item yacc -Incompatibilities with POSIX Yacc. - -@item conflicts-sr -@itemx conflicts-rr -S/R and R/R conflicts. These warnings are enabled by default. However, if -the @code{%expect} or @code{%expect-rr} directive is specified, an -unexpected number of conflicts is an error, and an expected number of -conflicts is not reported, so @option{-W} and @option{--warning} then have -no effect on the conflict report. - -@item deprecated -Deprecated constructs whose support will be removed in future versions of -Bison. - -@item empty-rule -Empty rules without @code{%empty}. @xref{Empty Rules}. Disabled by -default, but enabled by uses of @code{%empty}, unless -@option{-Wno-empty-rule} was specified. - @item precedence Useless precedence and associativity directives. Disabled by default. @@ -10450,6 +10447,9 @@ One would get the exact same parser with the following directives instead: @end group @end example +@item yacc +Incompatibilities with POSIX Yacc. + @item other All warnings not categorized above. These warnings are enabled by default. diff --git a/src/getargs.c b/src/getargs.c index 8673d41c..2a0493a1 100644 --- a/src/getargs.c +++ b/src/getargs.c @@ -335,13 +335,13 @@ Output:\n\ fputs (_("\ Warning categories include:\n\ - 'midrule-values' unset or unused midrule values\n\ - 'yacc' incompatibilities with POSIX Yacc\n\ 'conflicts-sr' S/R conflicts (enabled by default)\n\ 'conflicts-rr' R/R conflicts (enabled by default)\n\ 'deprecated' obsolete constructs\n\ 'empty-rule' empty rules without %empty\n\ + 'midrule-values' unset or unused midrule values\n\ 'precedence' useless precedence and associativity\n\ + 'yacc' incompatibilities with POSIX Yacc\n\ 'other' all other warnings (enabled by default)\n\ 'all' all the warnings except 'yacc'\n\ 'no-CATEGORY' turn off warnings in CATEGORY\n\