malloc()

Daniel R. Levy levy at ttrdc.UUCP
Mon May 19 12:23:17 AEST 1986


In article <5462 at alice.uUCp>, ark at alice.UucP (Andrew Koenig) writes:
>>    I don't think 'void *' is useless. What do you  do	on  a  machine
>> where it's NOT 'always legal to cast any pointer into a "char *"'?
>
>You don't implement C on it.

Why not?  If a "char *" per se (the machine's idea of a byte address) doesn't
contain sufficient information to reconstruct another type of address from it, 
you could always have the compiler generate code to carry around enough extra
information with the C pointers to allow reconstruction of pointers to larger
data types.

Can anyone name such a machine which wouldn't be amenable to this?  I'm not
talking about machines that are hostile to unbridled pointers like the
Burroughs beasts (no hardware memory protection).  I'm talking about machines
whose byte and word addressing schemes have no relationship whatsoever.
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
						vax135}!ttrdc!levy



More information about the Comp.lang.c mailing list