From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ratyt-0004ES-8V for qemu-devel@nongnu.org; Wed, 14 Dec 2011 13:55:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ratyq-0000pi-6W for qemu-devel@nongnu.org; Wed, 14 Dec 2011 13:55:07 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:43131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ratyp-0000ou-Kx for qemu-devel@nongnu.org; Wed, 14 Dec 2011 13:55:03 -0500 Message-ID: <4EE8F0D4.3050300@weilnetz.de> Date: Wed, 14 Dec 2011 19:54:12 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1323879637-16901-1-git-send-email-aliguori@us.ibm.com> <1323879637-16901-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] memory: make memory API parsable by gtkdoc-scan List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Anthony Liguori , qemu-devel@nongnu.org, Avi Kivity Am 14.12.2011 17:34, schrieb malc: > On Wed, 14 Dec 2011, Anthony Liguori wrote: > >> GTK/glib uses a convenient of: >> >> typedef struct _CamelCase CamelCase; >> >> The reason that they use a separate struct name is that in C++, the >> struct >> namespace not a separate namespace from the type namespace. This is >> actually a >> reasonable policy for QEMU to adopt as we eventually start exporting >> C libraries >> that may be consumed by C++ programs. >> >> I think the use of _ does not violate the C specification as the struct >> namespace is not the same as the type namespace which is what the C >> spec refers >> to if I understand it correctly. > > It does violate the standard _ followed by upper case letter is reserved > in all contexts. sCamelCase instead of _CamelCase seems to work, too. I just finished a first test with gtk-doc and had no problems. So it's possible to support gtk-doc (which is a good thing) _and_ keep the standard (which is very important, too). The new rule for structure declarations in QEMU could be like this: /* forward declaration */ struct sCamelCase; /* struct definition */ typedef struct sCamelCase { /* values follow here ... */ } CamelCase; Structures which don't need a forward declaration can use simplified definitions: typedef struct { /* values follow here ... */ } CamelCaseWithoutForwardDeclaration; Regards, Stefan Weil