From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JtiLA-0000lb-S4 for qemu-devel@nongnu.org; Wed, 07 May 2008 08:01:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JtiL8-0000jm-Tb for qemu-devel@nongnu.org; Wed, 07 May 2008 08:01:44 -0400 Received: from [199.232.76.173] (port=36104 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JtiL8-0000jA-7N for qemu-devel@nongnu.org; Wed, 07 May 2008 08:01:42 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JtiL7-0004ue-HZ for qemu-devel@nongnu.org; Wed, 07 May 2008 08:01:41 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m47C1Zqb032736 for ; Wed, 7 May 2008 08:01:35 -0400 Received: from file.fab.redhat.com (file.fab.redhat.com [10.33.63.6]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m47C1XCG026753 for ; Wed, 7 May 2008 08:01:34 -0400 Received: (from berrange@localhost) by file.fab.redhat.com (8.13.1/8.13.1/Submit) id m47C1XGD025491 for qemu-devel@nongnu.org; Wed, 7 May 2008 13:01:33 +0100 Date: Wed, 7 May 2008 13:01:33 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] Re: [4363] MusicPal: fix gcc4 build (Jan Kiszka). Message-ID: <20080507120132.GC20573@redhat.com> References: <4820810A.6060607@web.de> <200805071253.45209.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805071253.45209.paul@codesourcery.com> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Wed, May 07, 2008 at 12:53:42PM +0100, Paul Brook wrote: > > I'm not sure what's wrong with void * arithmetics though. They are > > specified (somewhere) to work as if the type was a char *, and the > > only annoyance is that you have to remember that. > > It doesn't work in C++ for a start. > I thought it was a GCC extension, though I could be wrong about that. IIRC, arithmetic on void * is said to be undefined by the standard - GCC treats them the same as char * as a 'convenience' for people... `-Wpointer-arith' Warn about anything that depends on the "size of" a function type or of `void'. GNU C assigns these types a size of 1, for convenience in calculations with `void *' pointers and pointers to functions. So I'd say better off just using char * so the behaviour is guarenteed to be defined & consistent across compilers. Dan. -- |: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|