mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
qapi: Reserve '*List' type names for list types
Type names ending in 'List' can clash with qapi list types in
generated C. We don't currently use such names. It is easier to
outlaw them now than to worry about how to resolve such a clash
in the future. For precedence, see commit 4dc2e69
, which did the
same for names ending in 'Kind' versus implicit enum types for
qapi unions.
Update the testsuite to match.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1445898903-12082-5-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
f9e6102b48
commit
255960dd37
6 changed files with 11 additions and 14 deletions
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/reserved-type-list.json:5: struct 'FooList' should not end in 'List'
|
|
@ -1 +1 @@
|
|||
0
|
||||
1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Potential C name collision
|
||||
# FIXME - This parses and compiles on its own, but prevents the user from
|
||||
# creating a type named 'Foo' and using ['Foo'] for an array. We should
|
||||
# reject the use of any type names ending in 'List'.
|
||||
# We reserve names ending in 'List' for use by array types.
|
||||
# TODO - we could choose array names to avoid collision with user types,
|
||||
# in order to let this compile
|
||||
{ 'struct': 'FooList', 'data': { 's': 'str' } }
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
object :empty
|
||||
object FooList
|
||||
member s: str optional=False
|
Loading…
Add table
Add a link
Reference in a new issue