mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
Don't let -Wnone disable -Werror.
Discussed at <http://lists.gnu.org/archive/html/bison-patches/2010-08/msg00009.html>. * NEWS (2.5): Document. * src/getargs.c (flags_argmatch): Accept a new argument that specifies what flags "all" and thus "none" affect. (FLAGS_ARGMATCH): Update flags_argmatch invocation. * tests/input.at (-Werror is not affected by -Wnone and -Wall): New test group.
This commit is contained in:
@@ -1308,3 +1308,36 @@ AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]],
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
## --------------------------------------------- ##
|
||||
## -Werror is not affected by -Wnone and -Wall. ##
|
||||
## --------------------------------------------- ##
|
||||
|
||||
AT_SETUP([[-Werror is not affected by -Wnone and -Wall]])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%%
|
||||
foo-bar: ;
|
||||
]])
|
||||
|
||||
# -Werror is not enabled by -Wall or equivalent.
|
||||
AT_BISON_CHECK([[-Wall input.y]], [[0]], [[]],
|
||||
[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
|
||||
]])
|
||||
AT_BISON_CHECK([[-W input.y]], [[0]], [[]],
|
||||
[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
|
||||
]])
|
||||
AT_BISON_CHECK([[-Wno-none input.y]], [[0]], [[]],
|
||||
[[input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
|
||||
]])
|
||||
|
||||
# -Werror is not disabled by -Wnone or equivalent.
|
||||
AT_BISON_CHECK([[-Werror,none,yacc input.y]], [[1]], [[]], [[stderr]])
|
||||
AT_CHECK([[sed 's/^.*bison:/bison:/' stderr]], [[0]],
|
||||
[[bison: warnings being treated as errors
|
||||
input.y:2.1-7: warning: POSIX Yacc forbids dashes in symbol names: foo-bar
|
||||
]])
|
||||
[mv stderr experr]
|
||||
AT_BISON_CHECK([[-Werror,no-all,yacc input.y]], [[1]], [[]], [[experr]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user