From: Amos Kong <akong@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, jyang@redhat.com,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] monitor: introduce query-config-schema command
Date: Thu, 25 Apr 2013 10:03:08 +0800 [thread overview]
Message-ID: <20130425020308.GD3230@t430s.nay.redhat.com> (raw)
In-Reply-To: <51788A85.20500@redhat.com>
On Wed, Apr 24, 2013 at 07:44:37PM -0600, Eric Blake wrote:
> On 04/24/2013 07:35 PM, Luiz Capitulino wrote:
>
> >> case QEMU_OPT_SIZE:
> >> param_info->type = CONFIG_PARAM_TYPE_SIZE;
> >> break;
> >> }
> >
> > Looks good.
> >
> >> I think we don't need default here, until some add new items in enum
> >> QemuOptType without update this code.
> >
> > Maybe we can have:
> >
> > default:
> > abort();
> >
> > So that we catch new QEmuOpts types not accompanied by a new ConfigParamType
> > type.
>
> gcc is able to warn about missed options if you omit a default case (and
> if the switch was on an actual enum type); but does not warn about
> missed options if you do have a default case. Libvirt has actually been
> switching to default-free coding styles on any switch statement where we
> expect an enum will grow in the future, for that reason.
util/qemu-config.c: In function ‘qmp_query_command_line_options’:
util/qemu-config.c:60:17: error: enumeration value ‘QEMU_OPT_NEW’ not
handled in switch [-Werror=switch]
cc1: all warnings being treated as errors
Good! no need default case here.
--
Amos.
next prev parent reply other threads:[~2013-04-25 2:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 12:47 [Qemu-devel] [RESEND PATCH 1/2] qapi: introduce strList and visit_type_strList() Amos Kong
2013-04-24 12:47 ` [Qemu-devel] [PATCH 2/2] monitor: introduce query-config-schema command Amos Kong
2013-04-24 14:38 ` Eric Blake
2013-04-24 16:45 ` Anthony Liguori
2013-04-24 17:33 ` [Qemu-devel] [PATCH] " Amos Kong
2013-04-24 17:36 ` [Qemu-devel] [PATCH v2] " Amos Kong
2013-04-24 18:20 ` [Qemu-devel] [PATCH] " Luiz Capitulino
2013-04-24 19:39 ` Eric Blake
2013-04-24 23:55 ` Eric Blake
2013-04-25 3:52 ` Amos Kong
2013-04-25 4:27 ` Osier Yang
2013-04-25 5:09 ` Amos Kong
2013-04-25 12:36 ` Luiz Capitulino
2013-04-25 13:30 ` Eric Blake
2013-04-25 1:14 ` Amos Kong
2013-04-25 1:35 ` Luiz Capitulino
2013-04-25 1:44 ` Eric Blake
2013-04-25 2:03 ` Amos Kong [this message]
2013-04-25 2:14 ` Luiz Capitulino
2013-04-25 1:43 ` Eric Blake
2013-04-25 3:38 ` Osier Yang
2013-04-24 14:01 ` [Qemu-devel] [RESEND PATCH 1/2] qapi: introduce strList and visit_type_strList() Eric Blake
2013-04-24 15:59 ` Amos Kong
2013-04-24 14:39 ` Eric Blake
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=20130425020308.GD3230@t430s.nay.redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=jyang@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).