[PATCH 6/6] [POWERPC] make struct property's value a void *
Paul Mackerras
paulus at samba.org
Tue Apr 10 04:20:22 EST 2007
Segher Boessenkool writes:
> Pointers never alias anything. It's the data accesses
> that matter. You cannot access one type as another type
> and expect it to work (unless one of those types is a
> character type); that's the one simple rule.
This is true according to the standard (as I understand it), and also
a classic example of the C standards committee stuffing up the C
language by trying to turn it into a "high-level" language. From the
earliest days of C on the PDP-11 it was understood that memory was an
array of bytes which could be addressed and interpreted in any way the
programmer chose. For systems programming tasks that is a very useful
facility, and one which the kernel code generally assumes. It's a
pity IMHO that the committee chose to throw that away (and yes I
understand that throwing it away makes more optimization opportunities
available).
Paul.
More information about the Linuxppc-dev
mailing list