mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
diagnostics: revamp the handling of -Werror
Recent discussions with Joel E. Denny (http://lists.gnu.org/archive/html/bison-patches/2013-02/msg00026.html) show that it is desirable to tell the difference between an option that was explicitly disabled with -Wno-foo, as opposed to be left unset. The current framework does not allow this. Instead of having a first int to store which options are enabled, and another to store which are turned into errors, use an array that for each warning category tells its status: disabled, unset, warning, error. * src/complain.h, src/complain.c (warning_bit): New enum. (warnings): Use it. (severity): New enum. (warnings_flag): Now an array of severity. (errors_flag): Remove, now done by warnings_flag. (complain_init): New function, to initialie warnings_flag. (warnings_are_errors): New Boolean, for -Werror. * src/complain.c (warning_severity): New. (warnings_print_categories, complains): Use it. * src/getargs.c (warning_argmatch): Adjust to use warnings_flag. (warnings_argmatch): Ditto. Handle -Werror and -Wno-error here. (getargs): Adjust. * src/main.c (main): Call complain_init. * tests/input.at (Invalid options): Add more corner cases.
This commit is contained in:
@@ -36,6 +36,10 @@ exp: '0'
|
||||
AT_BISON_CHECK([-ferror=caret input.y], [1], [], [ignore])
|
||||
AT_BISON_CHECK([--report=error=itemsets input.y], [1], [], [ignore])
|
||||
|
||||
# We used to accept any character after "-Werror", instead of ensuring
|
||||
# this is "=".
|
||||
AT_BISON_CHECK([-Werror?all input.y], [1], [], [ignore])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user