From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyzfl-00031X-9W for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:09:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyzfh-0005QR-84 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:09:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyzfh-0005QM-32 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 05:09:01 -0500 From: Markus Armbruster References: <1447836791-369-1-git-send-email-eblake@redhat.com> <1447836791-369-14-git-send-email-eblake@redhat.com> Date: Wed, 18 Nov 2015 11:08:58 +0100 In-Reply-To: <1447836791-369-14-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 18 Nov 2015 01:52:48 -0700") Message-ID: <87d1v7vcud.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v12 13/36] qapi: Hoist tag collision check to Variants.check() 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: > *** WARNING: THE ATTACHED DOCUMENT(S) CONTAIN MACROS *** > *** MACROS MAY CONTAIN MALICIOUS CODE *** > *** Open only if you can verify and trust the sender *** > *** Please contact infosec@redhat.com if you have questions or concerns ** Looks like infosec crapped over your commit message. > Checking that a given QAPISchemaObjectTypeVariant.name is a > member of the corresponding QAPISchemaEnumType of the owning > QAPISchemaObjectTypeVariants.tag_member ensures that there are > no collisions in the generated C union for those tag values > (since the enum itself should have no collisions). > > However, ever since its introduction in f51d8c3d, this was the > only additional action of of Variant.check(), beyond calling > the superclass Member.check(). This forces a difference in > .check() signatures, just to pass the enum type down. > > Simplify things by instead doing the tag name check as part of > Variants.check(), at which point we can rely on inheritance > instead of overriding Variant.check(). > > Signed-off-by: Eric Blake Can bury the infosec turd on merge.