From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPTNJ-0001ZC-Pg for qemu-devel@nongnu.org; Tue, 19 Jul 2016 07:39:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPTNH-0001uW-9V for qemu-devel@nongnu.org; Tue, 19 Jul 2016 07:39:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPTNH-0001uO-3V for qemu-devel@nongnu.org; Tue, 19 Jul 2016 07:39:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3B427F7C3 for ; Tue, 19 Jul 2016 11:39:42 +0000 (UTC) From: Markus Armbruster Date: Tue, 19 Jul 2016 13:39:27 +0200 Message-Id: <1468928377-20384-6-git-send-email-armbru@redhat.com> In-Reply-To: <1468928377-20384-1-git-send-email-armbru@redhat.com> References: <1468928377-20384-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL for-2.7 05/15] qapi: Special case c_name() for empty type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Eric Blake Commit 7ce106a rendered QAPISchemaObjectType.c_name() redundant, since it now does nothing more than delegate to its superclass. However, rather than deleting it, we can restore part of the assertion that was removed in that commit, to prove that we never emit the empty type directly in generated code, but rather special-case it as a built-in that makes other aspects of code generation easier to reason about. Reported-by: Markus Armbruster Signed-off-by: Eric Blake Message-Id: <1468468228-27827-4-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/qapi.py b/scripts/qapi.py index 0635bbb..68ee319 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1000,6 +1000,7 @@ class QAPISchemaObjectType(QAPISchemaType): return self.name.startswith('q_') def c_name(self): + assert self.name != 'q_empty' return QAPISchemaType.c_name(self) def c_type(self): -- 2.5.5