From: Tom Tromey <tromey@redhat.com>
To: gcc@gcc.gnu.org
Subject: -Wswitch and default case
Date: Wed, 14 Nov 2001 02:59:00 -0000 [thread overview]
Message-ID: <87k7whdtlt.fsf@creche.redhat.com> (raw)
I've run into a case where I'd like to use -Wswitch but also have a
default case in my switch.
Suppose I have a switch for something like a bytecode interpreter (my
actual situation is the Java bytecode verifier). I have a large
number of bytecodes, which are in an enum. I'd like to make sure I
don't forget one of the opcodes in one of my switches, so I'd like to
use -Wswitch. But at the same time if there is a bogus bytecode, I'd
like to catch that in a `default' case. Unfortunately the presence of
a default case eliminates whatever utility -Wswitch might have
provided.
I know somebody has wanted this before:
http://gcc.gnu.org/ml/gcc/2000-11/msg00854.html
Has anybody tried to implement this change?
If not I'll submit a feature request.
Tom
next reply other threads:[~2001-11-23 22:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-14 2:59 Tom Tromey [this message]
2001-11-14 21:19 ` Hartmut Schirmer
2001-11-15 6:32 ` Alexandre Oliva
2001-11-14 17:08 Claus Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k7whdtlt.fsf@creche.redhat.com \
--to=tromey@redhat.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).