(void *)
Guy Harris
guy at sun.uucp
Sat Jul 27 20:02:53 AEST 1985
> I just realised a major problem with (void *). On machines like the HP-1000
> a pointer to a byte and a pointer to a word don't have the same bit-pattern.
> How are you supposed to deal with this without having a terribly
> in-efficient implementation of 'C'.
This problem already exists in C. "malloc" returns a "char *"; it requires
work to turn it into an "int *". After "void *" becomes available, "malloc"
will return a "void *" (which would either be a byte pointer - in which case
the generated code would be exactly the same - or a word pointer, in which
case the code assigning the result to a "char *" would have to convert and
the code assigning it to another kind of pointer probably wouldn't.)
"void *" introduces no problems of this sort that aren't already in C due to
the existence of "char *".
Guy Harris
More information about the Comp.lang.c
mailing list