Re: [PATCH] HID: roccat: Drop cast

From: Joe Perches
Date: Sun Jun 29 2014 - 14:26:01 EST


On Sun, 2014-06-29 at 18:34 +0200, Julia Lawall wrote:
> On Thu, 26 Jun 2014, Joe Perches wrote:
> > void func(const void * const p)
> > {
> > char *p2 = p;
> >
> > p2[0] = 1;
> > }
>
> Is this a real example?

No, it's not.

I think I've seen code in the kernel like
char *p2 = (void *)p;
where p is const and p2 is dereferenced and set.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/