qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions
Date: Tue, 28 Aug 2012 18:23:38 +0100

On 28 August 2012 18:18, Michael S. Tsirkin <address@hidden> wrote:
> On Tue, Aug 28, 2012 at 05:24:40PM +0100, Peter Maydell wrote:
>>  C99 7.1.3
>> reserves underscore capital and double underscore prefixes.
>
> This is taking it out of context - reserved means different
> things in different parts of the spec.
>
> As far as I can see, 7.1.3 talks about what is permissible in headers:
> naturally when a libc implementation adds stuff in a header it would
> want to avoid breaking applications including this header. But
> it does not talk about what is permissible in a legal program - to avoid
> conflicts, you just need to use variables with reasonable names like
> kvmXXX qemuXXX or virtioXXX.

7.1.3 para 2 says "If the program declares or defines an identifier
in a context in which it is reserved [...] the behavior is undefined."
The rationale for 7.1.3 says that the underscore-cap and double
underscore identifiers are "reserved for the implementor" and that
"part of the name space of internal identifiers beginning with
underscore is available to the user" which implies that the rest
of that namespace is *not* available to the user.

I think that's fairly clear that we can't use these identifiers
without entering the realm of undefined behavior.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]