From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae3Bi-0000tA-1Z for qemu-devel@nongnu.org; Thu, 10 Mar 2016 11:11:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ae3Bd-0001CV-UQ for qemu-devel@nongnu.org; Thu, 10 Mar 2016 11:11:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ae3Bd-0001CN-Mt for qemu-devel@nongnu.org; Thu, 10 Mar 2016 11:11:41 -0500 References: <1457571335-10938-1-git-send-email-eblake@redhat.com> <1457571335-10938-5-git-send-email-eblake@redhat.com> <8737rytptn.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <56E19CBC.90605@redhat.com> Date: Thu, 10 Mar 2016 09:11:40 -0700 MIME-Version: 1.0 In-Reply-To: <8737rytptn.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6WAGKXrEpWoKLsJFaFjwkaXaoUIA0E23e" Subject: Re: [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6WAGKXrEpWoKLsJFaFjwkaXaoUIA0E23e Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/10/2016 06:39 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> The original choice of ':obj-' as the prefix for implicit types >> made it obvious that we weren't going to clash with any user-defined >> names. But now we want to create structs for implicit types. >=20 > Why? I know, but the commit message should still give a hint. Perhaps= : > "to get rid of special cases in the generators"? >=20 >> We >> could transliterate ':' to '_', except that C99 says that a leading >> underscore and lower-case letter should be used only for file scope >> identifiers, while we would be exposing it in qapi-types.h. So it's >=20 > Misunderstanding! When the standard says "identifiers that X are > reserved for Y use", it reserves these identifiers for itself and the > implementation. You shouldn't use them for Y then. >=20 > Suggest to simply quote the standard instead of interpreting it: > ... except that C99 mandates that "identifiers that begin with an > underscore are always reserved for use as identifiers with file scope i= n > both the ordinary and tag name spaces" Both those changes sound fine. >=20 >> time to change our naming convention; we can instead use the 'q_' >> prefix that we reserved for ourselves back in commit 9fb081e0. As >> long as we don't declare 'empty' or 'obj' ticklish, it shouldn't >> clash with c_name() prepending 'q_' to the user's ticklish names. >=20 > Do we really want to rename :empty? We're not going to generate C for > it, are we? No, but it was easier to implement .is_implicit() as "name.startswith('q_')" than as "name =3D=3D ':empty' or name.startswith('q_obj')". I can stick with :empty if you want a respin, though. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6WAGKXrEpWoKLsJFaFjwkaXaoUIA0E23e 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/ iQEcBAEBCAAGBQJW4Zy8AAoJEKeha0olJ0NqfeYH/2aYbn6XvYQt+Zdd4wee44vn L9Zz9RAlauLdoldYHJT8zvIWK1ASLl7TiQa+s7Pkid08ZoZIYAaEK2f4oCvZTKBu hqtReryjfE8NHf8OGKzvyjZ9pLbkcn1jakx4xBjoy9ic13bNq3ZKqodqXEpBUdxD D31Y1a6+DNTMwLd7vn8QfTTszDeZrVmS/HPPeRJj5Zc3YJfA48CQYQ7hQ1UrntTi omW26B16OUoW2klaAPV9tNnpogCJHF1ZvWinJFO4v9KPvacjDCtXjcWCNASMPO/j Mmb6Cdvp4dqm30FAaXvFzQM1QLR3J2x2yyDphQkr5dYx6vtPvSBJ7EYUf/IjJ98= =1YMu -----END PGP SIGNATURE----- --6WAGKXrEpWoKLsJFaFjwkaXaoUIA0E23e--