From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>,
Paolo Bonzini <pbonzini@redhat.com>,
Michael Roth <michael.roth@amd.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: Re: [PATCH 1/2] qapi: Do not generate default switch case in gen_visit_object_members()
Date: Mon, 27 Feb 2023 14:14:53 +0100 [thread overview]
Message-ID: <87edqbqmgi.fsf@pond.sub.org> (raw)
In-Reply-To: <20230224155451.20211-2-philmd@linaro.org> ("Philippe =?utf-8?Q?Mathieu-Daud=C3=A9=22's?= message of "Fri, 24 Feb 2023 16:54:50 +0100")
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> When iterating over a QAPISchemaEnumType, all possible
> values are covered. The 'default' switch case is unreachable,
> remove it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> scripts/qapi/visit.py | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
> index 26a584ee4c..f66a31a963 100644
> --- a/scripts/qapi/visit.py
> +++ b/scripts/qapi/visit.py
> @@ -159,8 +159,6 @@ def gen_visit_object_members(name: str,
>
> ret += var.ifcond.gen_endif()
> ret += mcgen('''
> - default:
> - abort();
> }
> ''')
This results in a bunch of warnings like
warning: enumeration value ‘FOO__MAX’ not handled in switch [-Wswitch]
Obvious fix: squash into the next patch.
next prev parent reply other threads:[~2023-02-27 13:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-24 15:54 [PATCH 0/2] qapi: Simplify enum generation Philippe Mathieu-Daudé
2023-02-24 15:54 ` [PATCH 1/2] qapi: Do not generate default switch case in gen_visit_object_members() Philippe Mathieu-Daudé
2023-02-27 12:40 ` Juan Quintela
2023-02-27 13:14 ` Markus Armbruster [this message]
2023-02-24 15:54 ` [PATCH 2/2] qapi: Generate enum count as definition in gen_enum_lookup() Philippe Mathieu-Daudé
2023-02-24 21:16 ` Richard Henderson
2023-02-27 12:41 ` Juan Quintela
2023-02-27 13:10 ` Markus Armbruster
2023-03-15 10:32 ` Philippe Mathieu-Daudé
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=87edqbqmgi.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@redhat.com \
--cc=michael.roth@amd.com \
--cc=pavel.dovgaluk@ispras.ru \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanb@linux.vnet.ibm.com \
/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).