[XenPPC] Re: [Xen-devel] Re: [patch] fix void* arithmetic
On 29/8/06 10:18 pm, "Hollis Blanchard" <[EMAIL PROTECTED]> wrote: >> 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. We have code borrowed from Linux that doesn't like -Wpointer-arith very much, so we took the pragmatic path here. -- Keir ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] Re: [Xen-devel] Re: [patch] fix void* arithmetic
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 <[EMAIL PROTECTED]> 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 ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] Re: [Xen-devel] Re: [patch] fix void* arithmetic
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 <[EMAIL PROTECTED]> > > 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. -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel