From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6PeF-00084z-9x for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:32:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6PeB-0002AN-9a for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:32:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6PeB-0002AG-0Z for qemu-devel@nongnu.org; Tue, 28 Aug 2012 13:32:15 -0400 Date: Tue, 28 Aug 2012 20:32:52 +0300 From: "Michael S. Tsirkin" Message-ID: <20120828173251.GE3661@redhat.com> References: <20120828160116.GA3047@redhat.com> <20120828171832.GA3661@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] HACKING: remove bogus restrictions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Blue Swirl , Anthony Liguori , qemu-devel@nongnu.org, Stefan Hajnoczi On Tue, Aug 28, 2012 at 06:23:38PM +0100, Peter Maydell wrote: > On 28 August 2012 18:18, Michael S. Tsirkin 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. > I'll have to re-read that, I missed it. What about _t in POSIX? That seems fairly safe if name is long and qemu specific enough. -- MST