From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCoKm-0005ld-26 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:24:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCoKh-0002xI-Ms for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:24:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCoKh-0002wu-HB for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:24:43 -0400 From: Markus Armbruster References: <1463784024-17242-1-git-send-email-eblake@redhat.com> <1463784024-17242-4-git-send-email-eblake@redhat.com> Date: Tue, 14 Jun 2016 15:24:40 +0200 In-Reply-To: <1463784024-17242-4-git-send-email-eblake@redhat.com> (Eric Blake's message of "Fri, 20 May 2016 16:40:12 -0600") Message-ID: <87porjdht3.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 03/15] qapi: Require all branches of flat union enum to be covered List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Michael Roth Eric Blake 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 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.