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 <arm...@redhat.com>
Signed-off-by: Eric Blake <ebl...@redhat.com>

---
v9: new patch
---
 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


Reply via email to