diff options
author | Eric Blake | 2016-03-17 23:48:27 +0100 |
---|---|---|
committer | Markus Armbruster | 2016-03-18 10:29:25 +0100 |
commit | 972a110162677fe5155f68a718ec6e999cd059a7 (patch) | |
tree | b261494c40c0493beb52aeb01e0794ac8ec2e5a5 /tests/qapi-schema/qapi-schema-test.out | |
parent | qapi: Assert in places where variants are not handled (diff) | |
download | qemu-972a110162677fe5155f68a718ec6e999cd059a7.tar.gz qemu-972a110162677fe5155f68a718ec6e999cd059a7.tar.xz qemu-972a110162677fe5155f68a718ec6e999cd059a7.zip |
qapi: Fix command with named empty argument type
The generator special-cased
{ 'command':'foo', 'data': {} }
to avoid emitting a visitor variable, but failed to see that
{ 'struct':'NamedEmptyType, 'data': {} }
{ 'command':'foo', 'data':'NamedEmptyType' }
needs the same treatment. There, the generator happily generates a
visitor to get no arguments, and a visitor to destroy no arguments;
and the compiler isn't happy with that, as demonstrated by the updated
qapi-schema-test.json:
tests/test-qmp-marshal.c: In function ‘qmp_marshal_user_def_cmd0’:
tests/test-qmp-marshal.c:264:14: error: variable ‘v’ set but not used [-Werror=unused-but-set-variable]
Visitor *v;
^
No change to generated code except for the testsuite addition.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1458254921-17042-3-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/qapi-schema-test.out')
-rw-r--r-- | tests/qapi-schema/qapi-schema-test.out | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index f5e2a73c30..f53196105f 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -203,6 +203,8 @@ command guest-sync :obj-guest-sync-arg -> any gen=True success_response=True command user_def_cmd None -> None gen=True success_response=True +command user_def_cmd0 Empty2 -> Empty2 + gen=True success_response=True command user_def_cmd1 :obj-user_def_cmd1-arg -> None gen=True success_response=True command user_def_cmd2 :obj-user_def_cmd2-arg -> UserDefTwo |