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.
(cherry picked from commit dab9663283)
This commit is contained in:
Joel E. Denny
2011-03-27 15:39:25 -04:00
parent 86408959da
commit bf0e44e87c
4 changed files with 72 additions and 17 deletions

View File

@@ -1314,3 +1314,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