summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel E. Denny <joeldenny@joeldenny.org>2011-03-27 15:39:25 -0400
committerJoel E. Denny <joeldenny@joeldenny.org>2011-04-09 13:00:06 -0400
commitbf0e44e87c31bbab569c76e94ced6f4230e69f1f (patch)
tree9ef8adec66d647f81cd196fc35315dd023aa458d /tests
parent86408959da5eddf26493eef64f049034a7849e2a (diff)
downloadbison-bf0e44e87c31bbab569c76e94ced6f4230e69f1f.tar.gz
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 dab9663283437092d17af8ede75f3aff33380d53)
Diffstat (limited to 'tests')
-rw-r--r--tests/input.at33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/input.at b/tests/input.at
index ada68261..8d1e80d1 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -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