mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
errors: change output, and improve -y coherence
The prefix of warnings treated as errors is now "error: ". Also, their suffix now reflects the changes in the Werror option format. An output for -Werror=other used to be: bison: warnings being treated as errors input.y:1.1: warning: stray ',' treated as white space [-Wother] It is now: bison: warnings being treated as errors input.y:1.1: error: stray ',' treated as white space [-Werror=other] The line "warnings being treated as errors" no longer adds any info, it will be removed in a forthcoming change. * NEWS: Add entry "Enhancement of the -Werror" * doc/bison.texi: Move the warnings-as-error to a new bullet. * src/complain.c (complains): Refactor, change the prefix of warnings that are treated as errors. (warnings_print_categories): Support for [-Werror=CATEGORY] display * src/getargc.c (getargs): -y implies -Werror=yacc * tests/input.at: Update expected --yacc output for coherence. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
This commit is contained in:
@@ -9263,12 +9263,33 @@ 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.
|
||||
|
||||
@item -Werror[=@var{category}]
|
||||
@itemx -Wno-error[=@var{category}]
|
||||
Enable warnings falling in @var{category}, and treat them as errors. If no
|
||||
@var{category} is given, it defaults to making all enabled warnings into errors.
|
||||
|
||||
@var{category} 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
|
||||
@var{category}. However, the warning itself won't be disabled, or enabled, by
|
||||
this option.
|
||||
|
||||
Note that the precedence of the @samp{=} and @samp{,} operators is such that
|
||||
the following commands are @emph{not} equivalent, as the first will not treat
|
||||
S/R conflicts as errors.
|
||||
|
||||
@example
|
||||
$ bison -Werror=yacc,conflicts-sr input.y
|
||||
$ bison -Werror=yacc,error=conflicts-sr input.y
|
||||
@end example
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
|
||||
Reference in New Issue
Block a user