qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 03/15] qapi: Require all branches of flat uni


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v7 03/15] qapi: Require all branches of flat union enum to be covered
Date: Tue, 14 Jun 2016 15:24:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> We were previously enforcing that all flat union branches were
> found in the corresponding enum, but not that all enum values
> were covered by branches.  The resulting generated code would
> abort() if the user passes the uncovered enum value.
>
> Signed-off-by: Eric Blake <address@hidden>

I'd let the cases not mentioned default to the empty type (ample
precedence in other languages), but I can live with making the user ask
for the empty type explicitly.  But we should then make that less
cumbersome than now: you have to define an empty struct type, and use
that.  Examples of such hoop-jumping: CpuInfoOther, Abort,
NetdevNoneOptions.

Patch looks good.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]