All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic'
@ 2004-07-03 16:32 Paweł Sikora
  2004-07-04  0:18 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Paweł Sikora @ 2004-07-03 16:32 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

warning killed.

-- 
/* Copyright (C) 2003, SCO, Inc. This is valuable Intellectual Property. */

                           #define say(x) lie(x)

[-- Attachment #2: prefetch.h.diff --]
[-- Type: text/x-diff, Size: 354 bytes --]

--- /var/tmp/linux/include/linux/prefetch.h.orig	2004-06-16 07:20:25.000000000 +0200
+++ /var/tmp/linux/include/linux/prefetch.h	2004-07-03 18:28:10.478861720 +0200
@@ -59,7 +59,7 @@
 {
 #ifdef ARCH_HAS_PREFETCH
 	char *cp;
-	char *end = addr + len;
+	char *end = (char *)addr + len;
 
 	for (cp = addr; cp < end; cp += PREFETCH_STRIDE)
 		prefetch(cp);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic'
  2004-07-03 16:32 [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic' Paweł Sikora
@ 2004-07-04  0:18 ` Andrew Morton
  2004-07-04  6:49   ` Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2004-07-04  0:18 UTC (permalink / raw)
  To: Pawe__ Sikora; +Cc: linux-kernel

Pawe__ Sikora <pluto@pld-linux.org> wrote:
>
> warning killed.

>  --- /var/tmp/linux/include/linux/prefetch.h.orig	2004-06-16 07:20:25.000000000 +0200
>  +++ /var/tmp/linux/include/linux/prefetch.h	2004-07-03 18:28:10.478861720 +0200
>  @@ -59,7 +59,7 @@
>   {
>   #ifdef ARCH_HAS_PREFETCH
>   	char *cp;
>  -	char *end = addr + len;
>  +	char *end = (char *)addr + len;

What version of the compiler is generating this warning?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic'
  2004-07-04  0:18 ` Andrew Morton
@ 2004-07-04  6:49   ` Vojtech Pavlik
  2004-07-04  6:51     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2004-07-04  6:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Pawe__ Sikora, linux-kernel

On Sat, Jul 03, 2004 at 05:18:11PM -0700, Andrew Morton wrote:
> Pawe__ Sikora <pluto@pld-linux.org> wrote:
> >
> > warning killed.
> 
> >  --- /var/tmp/linux/include/linux/prefetch.h.orig	2004-06-16 07:20:25.000000000 +0200
> >  +++ /var/tmp/linux/include/linux/prefetch.h	2004-07-03 18:28:10.478861720 +0200
> >  @@ -59,7 +59,7 @@
> >   {
> >   #ifdef ARCH_HAS_PREFETCH
> >   	char *cp;
> >  -	char *end = addr + len;
> >  +	char *end = (char *)addr + len;
> 
> What version of the compiler is generating this warning?

As far as I know, any gcc if and only if you pass "-Wpointer-arith" to
it. The kernel doesn't do that, leaving me wondering ...

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic'
  2004-07-04  6:49   ` Vojtech Pavlik
@ 2004-07-04  6:51     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2004-07-04  6:51 UTC (permalink / raw)
  To: Vojtech Pavlik; +Cc: pluto, linux-kernel

Vojtech Pavlik <vojtech@suse.cz> wrote:
>
> On Sat, Jul 03, 2004 at 05:18:11PM -0700, Andrew Morton wrote:
> > Pawe__ Sikora <pluto@pld-linux.org> wrote:
> > >
> > > warning killed.
> > 
> > >  --- /var/tmp/linux/include/linux/prefetch.h.orig	2004-06-16 07:20:25.000000000 +0200
> > >  +++ /var/tmp/linux/include/linux/prefetch.h	2004-07-03 18:28:10.478861720 +0200
> > >  @@ -59,7 +59,7 @@
> > >   {
> > >   #ifdef ARCH_HAS_PREFETCH
> > >   	char *cp;
> > >  -	char *end = addr + len;
> > >  +	char *end = (char *)addr + len;
> > 
> > What version of the compiler is generating this warning?
> 
> As far as I know, any gcc if and only if you pass "-Wpointer-arith" to
> it. The kernel doesn't do that, leaving me wondering ...
> 

This discussion fell off the mailing list (grr).

The warning was encountered when building the nvidia driver, and it indeed
uses -Wpointer-arith.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-04  6:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03 16:32 [PATCH] [prefetch.h] warning: pointer of type `void *' used in arithmetic' Paweł Sikora
2004-07-04  0:18 ` Andrew Morton
2004-07-04  6:49   ` Vojtech Pavlik
2004-07-04  6:51     ` Andrew Morton

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.