Warnings on void* arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

Building the nVidia driver gives this couple warnings. I send them just
to see if they are real bugs or not.

include/linux/prefetch.h: In function ‘prefetch_range’:
include/linux/prefetch.h:62: warning: pointer of type ‘void *’ used in arithmetic

static inline void prefetch_range(void *addr, size_t len)
                                  ^^^^^^
{
#ifdef ARCH_HAS_PREFETCH
    char *cp;
    char *end = addr + len; <<<<<<<<<<<<<

    for (cp = addr; cp < end; cp += PREFETCH_STRIDE)
        prefetch(cp);
#endif
}


include/asm/io.h: In function ‘check_signature’:
include/asm/io.h:258: warning: wrong type argument to increment

static inline int check_signature(volatile void __iomem * io_addr,
                                           ^^^^^^^^^^^^^^
    const unsigned char *signature, int length)
{
    int retval = 0;
    do {
        if (readb(io_addr) != *signature)
            goto out;
        io_addr++;    <<<<<<<<<<<<<<<<<<<
        signature++;
        length--;
    } while (length);
    retval = 1;
out:
    return retval;
}


--
J.A. Magallon <jamagallon()able!es>     \               Software is like sex:
werewolf!able!es                         \         It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.15-jam1 (gcc 4.0.2 (4.0.2-1mdk for Mandriva Linux release 2006.1))

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux