summaryrefslogtreecommitdiffstats
path: root/tests/qapi-schema/command-int.err
diff options
context:
space:
mode:
authorEric Blake2015-05-04 17:05:17 +0200
committerMarkus Armbruster2015-05-05 18:39:01 +0200
commit4dc2e6906e1084fdd37bf67385c5dcd2c72ae22b (patch)
tree38dbff47247cefd2448c56813de8bed894096c92 /tests/qapi-schema/command-int.err
parentqapi: Add tests of redefined expressions (diff)
downloadqemu-4dc2e6906e1084fdd37bf67385c5dcd2c72ae22b.tar.gz
qemu-4dc2e6906e1084fdd37bf67385c5dcd2c72ae22b.tar.xz
qemu-4dc2e6906e1084fdd37bf67385c5dcd2c72ae22b.zip
qapi: Better error messages for duplicated expressions
The previous commit demonstrated that the generator overlooked duplicate expressions: - a complex type or command reusing a built-in type name - redeclaration of a type name, whether by the same or different metatype - redeclaration of a command or event - collision of a type with implicit 'Kind' enum for a union - collision with an implicit MAX enum constant Since the c_type() function in the generator treats all names as being in the same namespace, this patch adds a global array to track all known names and their source, to prevent collisions before it can cause further problems. While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/command-int.err')
-rw-r--r--tests/qapi-schema/command-int.err1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qapi-schema/command-int.err b/tests/qapi-schema/command-int.err
index e69de29bb2..0f9300679b 100644
--- a/tests/qapi-schema/command-int.err
+++ b/tests/qapi-schema/command-int.err
@@ -0,0 +1 @@
+tests/qapi-schema/command-int.json:2: built-in 'int' is already defined