From: Jeff Garzik <jeff@garzik.org>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: xen-ppc-devel <xen-ppc-devel@lists.xensource.com>,
xen-devel <xen-devel@lists.xensource.com>,
Ian Campbell <Ian.Campbell@XenSource.com>
Subject: Re: Re: [patch] fix void* arithmetic
Date: Tue, 29 Aug 2006 17:26:28 -0400 [thread overview]
Message-ID: <44F4B104.1000301@garzik.org> (raw)
In-Reply-To: <1156886315.29858.78.camel@basalt.austin.ibm.com>
Hollis Blanchard wrote:
> On Tue, 2006-08-29 at 22:06 +0100, Ian Campbell wrote:
>> On Tue, 2006-08-29 at 15:24 -0500, Hollis Blanchard wrote:
>>> Hi Ian, I needed the following patch to avoid lots of these warnings:
>>> elf.c:238: warning: pointer of type `void *' used in arithmetic
>>>
>>> Fix void* arithmetic warnings.
>>> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
>> Looks like PPC is the only arch using -Wpointer-arith, is there a reason
>> for that?
>
> Is there are reason the other architectures *aren't* using it?
>
> We have some extra warnings enabled because they've helped us in the
> past (such as -Wshadow). Given that we're just playing janitor for
> everyone else's code though, I think we're about to abandon that one.
Pointer arith is quite valid on void pointers, when using gcc and most
other modern compilers.
Point of fact, any Linux kernel-related code REQUIRES that void* arith
be valid, and not cause warnings.
As we see from your patch, all a cast to char* does is complicate the
code, for zero gain.
Jeff
next prev parent reply other threads:[~2006-08-29 21:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-29 20:24 [patch] fix void* arithmetic Hollis Blanchard
2006-08-29 20:35 ` Aron Griffis
2006-08-29 21:06 ` Ian Campbell
2006-08-29 21:18 ` Hollis Blanchard
2006-08-29 21:26 ` Jeff Garzik [this message]
2006-08-30 16:35 ` Keir Fraser
2006-08-30 8:47 ` Jan Beulich
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=44F4B104.1000301@garzik.org \
--to=jeff@garzik.org \
--cc=Ian.Campbell@XenSource.com \
--cc=hollisb@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
--cc=xen-ppc-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.