Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgRYE-0007cb-JW for qemu-devel@nongnu.org; Wed, 26 Aug 2009 19:05:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgRY9-0007bN-PI for qemu-devel@nongnu.org; Wed, 26 Aug 2009 19:05:10 -0400 Received: from [199.232.76.173] (port=36889 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgRY9-0007bK-LU for qemu-devel@nongnu.org; Wed, 26 Aug 2009 19:05:05 -0400 Received: from lo.gmane.org ([80.91.229.12]:53794) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgRY8-0000a1-Vd for qemu-devel@nongnu.org; Wed, 26 Aug 2009 19:05:05 -0400 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MgRY7-000205-1X for qemu-devel@nongnu.org; Thu, 27 Aug 2009 01:05:03 +0200 Received: from unicorn.mansr.com ([78.86.181.103]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2009 01:05:03 +0200 Received: from mans by unicorn.mansr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Aug 2009 01:05:03 +0200 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Subject: Re: Coding style, C++ compatible code (was Re: [Qemu-devel] [PATCH 02/22] eepro100: cast a void * makes no sense) Date: Thu, 27 Aug 2009 00:03:21 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: news List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Kent Harris writes: > Stefan, > > I'm with you 100 percent. I already complained to this group a couple > of months ago about the void* casting issue (and also using "private" > as a structure element name as that barfs C++ as well -- there are > others.) > > For my situation, these problems within C-language source files are > not an issue but when they occur inside a QEMU header file that I must > include from my C++ device models, my compilations fail. > Consequently, I have a whole series of patch files to the QEMU source > that I have to apply to correct these (trivial) coding errors. Each > time a new QEMU release comes out, I have to recreate the patch > files. Frustrating to say the least. I have a great idea. For maximum portability, lets all start writing code like this: http://ideology.com.au/polyglot/polyglot.txt That way, it will work in almost any language, and everybody will be happy. -- Måns Rullgård mans@mansr.com