[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types |
Date: |
Thu, 10 Mar 2016 14:39:16 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> 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.
Why? I know, but the commit message should still give a hint. Perhaps:
"to get rid of special cases in the generators"?
> 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
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.
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 in
both the ordinary and tag name spaces"
> 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.
Do we really want to rename :empty? We're not going to generate C for
it, are we?
> Signed-off-by: Eric Blake <address@hidden>
- Re: [Qemu-devel] [PATCH v5 06/14] qapi-event: Slightly shrink generated code, (continued)
- [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits, Eric Blake, 2016/03/09
- [Qemu-devel] [PATCH v5 12/14] qapi: Make BlockdevOptions doc example closer to reality, Eric Blake, 2016/03/09
- [Qemu-devel] [PATCH v5 09/14] qapi: Inline gen_visit_members() into lone caller, Eric Blake, 2016/03/09
- [Qemu-devel] [PATCH v5 05/14] qapi: Emit implicit structs in generated C, Eric Blake, 2016/03/09
- [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types, Eric Blake, 2016/03/09
- Re: [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types,
Markus Armbruster <=
[Qemu-devel] [PATCH v5 13/14] qapi: Allow anonymous base for flat union, Eric Blake, 2016/03/09
[Qemu-devel] [PATCH v5 14/14] qapi: Use anonymous bases in QMP flat unions, Eric Blake, 2016/03/09
[Qemu-devel] [PATCH v5 11/14] qapi: Don't special-case simple union wrappers, Eric Blake, 2016/03/09
Re: [Qemu-devel] [PATCH v5 00/14] easier unboxed visits/qapi implicit types, Markus Armbruster, 2016/03/10