Philippe Mathieu-Daudé <phi...@linaro.org> writes: > Per the C++ standard, empty enum are ill-formed. Do not generate > them in order to avoid: > > In file included from qga/qga-qapi-emit-events.c:14: > qga/qga-qapi-emit-events.h:20:1: error: empty enum is invalid > 20 | } qga_QAPIEvent; > | ^ > > Reported-by: Markus Armbruster <arm...@redhat.com> > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Two failures in "make check-qapi-schema" (which is run by "make check"): 1. Positive test case qapi-schema-test --- /work/armbru/qemu/bld-x86/../tests/qapi-schema/qapi-schema-test.out +++ @@ -19,7 +19,6 @@ member enum2: EnumOne optional=True member enum3: EnumOne optional=False member enum4: EnumOne optional=True -enum MyEnum object Empty1 object Empty2 base Empty1 You forgot to update expected test output. No big deal. 2. Negative test case union-empty --- /work/armbru/qemu/bld-x86/../tests/qapi-schema/union-empty.err +++ @@ -1,2 +1,2 @@ -union-empty.json: In union 'Union': -union-empty.json:4: union has no branches +union-empty.json: In struct 'Base': +union-empty.json:3: member 'type' uses unknown type 'Empty' stderr: qapi-schema-test FAIL union-empty FAIL The error message regresses. I can see two ways to fix this: (A) You can't just drop empty enumeration types on the floor. To not generate code for them, you need to skip them wherever we generate code for enumeration types. (B) Outlaw empty enumeration types. I recommend to give (B) a try, it's likely simpler.