[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions |
Date: |
Thu, 30 Jul 2015 09:11:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 07/29/2015 01:33 AM, Markus Armbruster wrote:
>> Eric Blake <address@hidden> writes:
>>
>>> On 07/01/2015 02:21 PM, Markus Armbruster wrote:
>>>> The struct generated for a flat union is weird: the members of its
>>>> base are at the end, except for the union tag, which is renamed to
>>>> 'kind' and put at the beginning.
>>>
>
>>> Therefore, it might be worth mentioning that avoiding the rename to
>>> 'kind' is a bug fix, not just a nicer struct :)
>>
>> Cool! I'll work (a variation of) this test case into my series.
>
> Another name collision bug: our code generates flat unions as:
>
> struct BlockdevOptions {
> BlockdevDriver driver;
> ...
> /* End fields inherited from BlockdevOptionsBase. */
> /* union tag is BlockdevDriver driver */
> union {
> void *data;
> BlockdevOptionsArchipelago *archipelago;
> ...
>
> which means that if we name any of the branches 'data' (that is, if
> 'data' is a member of the enum discriminator), things fail to compile.
> We could probably fix that by naming our dummy branch '_data'.
I wonder whether member data is actually used. I'll find out.
- [Qemu-devel] [PATCH RFC v2 09/47] qapi-visit: Replace list implicit_structs by set, (continued)
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Eric Blake, 2015/07/28
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Markus Armbruster, 2015/07/29
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Eric Blake, 2015/07/29
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Eric Blake, 2015/07/30
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Markus Armbruster, 2015/07/30
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Eric Blake, 2015/07/30
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Markus Armbruster, 2015/07/31
- Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions, Markus Armbruster, 2015/07/31
[Qemu-devel] [PATCH RFC v2 01/47] qapi: Clarify docs on including the same file multiple times, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 05/47] qapi: Reject -p arguments that break qapi-event.py, Markus Armbruster, 2015/07/01