[PATCH 6/6] [POWERPC] make struct property's value a void *

Benjamin Herrenschmidt benh at kernel.crashing.org
Fri Apr 6 09:01:47 EST 2007


> It would remove the millions of casts (and the need for the GCC
> -fstrict-aliasing flag for this code).

Ugh ? We don't need casts with void *, that's the whole point ... while
we would do if we used char * ...

I'm not familiar with the details of the strict-breaking-good-programs
rules also known as strict-aliasing but isn't void * supposed to alias
all ? if not, that's really stupid... But even then, I fail to see how
this would break an aliasing rule as we aren't accessing the same object
from two different types and we aren't even writing to it.

> I agree.  However when making this code more generally useful,
> it would be good to make it more correct at the same time, since
> it will only get harder to do so later on.

I think it's perfectly correct with void * ...

Ben.





More information about the Linuxppc-dev mailing list