summaryrefslogtreecommitdiff
path: root/gcc/flags.h
diff options
context:
space:
mode:
authorcagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-23 16:33:44 +0000
committercagney <cagney@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-23 16:33:44 +0000
commit91b18148024f50688471ebf78eb295832af2bf4e (patch)
tree40bde56f3c0f0b034afa8251d7b684434a00dddd /gcc/flags.h
parent9f20a11114ea77cc45ed4ceb31f1c40773993607 (diff)
downloadgcc-91b18148024f50688471ebf78eb295832af2bf4e.tar.gz
2002-03-23 Andrew Cagney <ac131313@redhat.com>
* doc/invoke.texi (Option Summary): Mention -Wswitch-default. (Warning Options): Document -Wswitch-default. * toplev.c (W_options): Add -Wswitch-default. Update comment on -Wswitch. (warn_switch_default): Define variable. (warn_switch): Update comment. * flags.h (warn_switch_default): Declare variable. (warn_switch): Update comment. * stmt.c (expand_end_case): Check for and, when warn_switch_no_default, warn of a missing default case. Index: f/ChangeLog Sat Mar 23 11:18:17 2002 Andrew Cagney <ac131313@redhat.com> * invoke.texi (Warning Options): Mention -Wswitch-default. Index: testsuite/ChangeLog 2002-03-23 Andrew Cagney <ac131313@redhat.com> * gcc.dg/Wswitch-default.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flags.h')
-rw-r--r--gcc/flags.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/flags.h b/gcc/flags.h
index a3e4a043bf5..ee9753a943b 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -126,10 +126,15 @@ extern int warn_unknown_pragmas;
extern int warn_shadow;
-/* Warn if a switch on an enum fails to have a case for every enum value. */
+/* Warn if a switch on an enum, that does not have a default case,
+ fails to have a case for every enum value. */
extern int warn_switch;
+/* Warn if a switch does not have a default case. */
+
+extern int warn_switch_default;
+
/* Nonzero means warn about function definitions that default the return type
or that use a null return and have a return-type other than void. */