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-03 17:51:14 -0400
commitdab9663283437092d17af8ede75f3aff33380d53 (patch)
tree137945cb07e4d37065dbe520e56492c902e0bab8 /tests
parent248dba53cb3a33b6cea83050263080f6f000fbfe (diff)
downloadbison-dab9663283437092d17af8ede75f3aff33380d53.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.
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 9acd5448..c8e28be7 100644
--- a/tests/input.at
+++ b/tests/input.at
@@ -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