From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgPbe-0004qQ-Ot for qemu-devel@nongnu.org; Wed, 26 Aug 2009 17:00:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgPbZ-0004qA-CC for qemu-devel@nongnu.org; Wed, 26 Aug 2009 17:00:33 -0400 Received: from [199.232.76.173] (port=40982 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgPbZ-0004q7-7P for qemu-devel@nongnu.org; Wed, 26 Aug 2009 17:00:29 -0400 Received: from mail2.shareable.org ([80.68.89.115]:33042) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgPbX-0004xe-Od for qemu-devel@nongnu.org; Wed, 26 Aug 2009 17:00:27 -0400 Date: Wed, 26 Aug 2009 22:00:16 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense) Message-ID: <20090826210016.GA691@shareable.org> References: <51486eb6860d1680c1bce45e310dcd3aae096f43.1251111439.git.quintela@redhat.com> <4A928DF0.9000106@weilnetz.de> <87tyzxnwvb.fsf@pike.pond.sub.org> <4A953E20.8080806@mail.berlios.de> <4A954B61.4010708@redhat.com> <20090826170402.GA25726@shareable.org> <20090826190335.GG25726@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org, Anthony Liguori , Gerd Hoffmann , Markus Armbruster malc wrote: > On Wed, 26 Aug 2009, Jamie Lokier wrote: > > malc wrote: > > > > > (1) structs pointing to each other, like this: > > > > > > > > > > typedef struct A A; > > > > > typedef struct B B; > > > > > > > > You can use "typedef struct _A A" to be C++ compatible, but it fails > > > > to be shorter so I wouldn't recommend it ;-) > > > > > > This is neither C nor C++ compatible, in fact it breaks both. > > > > You'll have to explain that statement. > > ISO/IEC 9899:1999 7.1.3#1 > and 17.4.3.1.2 of n2315 (Draft of c++0x) > > mandate that those names are reserved. The _A is just an example; just substitute an identifier you're happy with. Use lower case, or put the underscore at the end, or something else. It's actively unhelpful to say "that is not C/C++ compatible" without explaining that it's for an tangential reason which is easily avoided. -- Jamie