diff options
author | Andrew Cagney <ac131313@redhat.com> | 2002-03-23 16:33:44 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@gcc.gnu.org> | 2002-03-23 16:33:44 +0000 |
commit | d6961341dd0ef37d0c292d25f7e428a42e22b0c0 (patch) | |
tree | 40bde56f3c0f0b034afa8251d7b684434a00dddd /gcc/flags.h | |
parent | c677cd7f47af8d4c2ebc387e4a1d49321bb660a6 (diff) | |
download | gcc-d6961341dd0ef37d0c292d25f7e428a42e22b0c0.zip gcc-d6961341dd0ef37d0c292d25f7e428a42e22b0c0.tar.gz gcc-d6961341dd0ef37d0c292d25f7e428a42e22b0c0.tar.bz2 |
[multiple changes]
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.
From-SVN: r51238
Diffstat (limited to 'gcc/flags.h')
-rw-r--r-- | gcc/flags.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/flags.h b/gcc/flags.h index a3e4a04..ee9753a 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. */ |