From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKXkv-0001rH-CS for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKXks-0007E7-0w for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:15:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKXkr-0007Dh-SG for qemu-devel@nongnu.org; Wed, 29 Jul 2015 16:15:09 -0400 References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-8-git-send-email-armbru@redhat.com> <55B7E15D.50902@redhat.com> <87lhdzju4i.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <55B93445.9060104@redhat.com> Date: Wed, 29 Jul 2015 14:15:01 -0600 MIME-Version: 1.0 In-Reply-To: <87lhdzju4i.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Eqn1uMmubPabSHbC1NAJFL35DJhwSF32P" Subject: Re: [Qemu-devel] [PATCH RFC v2 07/47] qapi: Generate a nicer struct for flat unions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, berto@igalia.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Eqn1uMmubPabSHbC1NAJFL35DJhwSF32P Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/29/2015 01:33 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> 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 :) >=20 > 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; =2E.. /* End fields inherited from BlockdevOptionsBase. */ /* union tag is BlockdevDriver driver */ union { void *data; BlockdevOptionsArchipelago *archipelago; =2E.. 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'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Eqn1uMmubPabSHbC1NAJFL35DJhwSF32P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVuTRFAAoJEKeha0olJ0NqqcMH/RSrf4RPHyVeRjSt4myfQ+lX jQZx0qC6Db1OtvXnAgsolTUDA5htX6YT1J8FJoOgpL1IoQ8C/4gUBZBoRdXOWDjP ojXblNFMvYauoaRB93gYl6gk/BmmA70f8jaz1Tpi4CPsSxwOoPJfTlIXq14c17+8 VMbAeT3MDIkiyLsAKHRRIs3iMQFt6jE1b7cRm3Peun64DyrKQ7trZZL7gZueGbgR oBshBS70Y0c+/dHM9cGTUdT/JEh6qfR9LtULBdoVhaPbvZpSTfpb7r+i1QM8sRJC HNTF6HBlAJf7MbTASllfx8QXx9gd/YASC1ArWVzKZzWiAL/PyPvs0vKMwzGG574= =GLfQ -----END PGP SIGNATURE----- --Eqn1uMmubPabSHbC1NAJFL35DJhwSF32P--