qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [4363] MusicPal: fix gcc4 build (Jan Kiszka).
Date: Wed, 7 May 2008 13:01:33 +0100	[thread overview]
Message-ID: <20080507120132.GC20573@redhat.com> (raw)
In-Reply-To: <200805071253.45209.paul@codesourcery.com>

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 :|

  reply	other threads:[~2008-05-07 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 15:01 [Qemu-devel] [4363] MusicPal: fix gcc4 build (Jan Kiszka) Andrzej Zaborowski
2008-05-06 15:25 ` Paul Brook
2008-05-06 16:02   ` [Qemu-devel] " Jan Kiszka
2008-05-07 11:39     ` andrzej zaborowski
2008-05-07 11:53       ` Paul Brook
2008-05-07 12:01         ` Daniel P. Berrange [this message]
2008-05-07 12:26           ` Andreas Schwab
2008-05-07 12:04         ` Andreas Schwab
2008-05-07 13:53         ` andrzej zaborowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080507120132.GC20573@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).