malloc()

Walter Bright bright at dataioDataio.UUCP
Wed May 28 03:30:11 AEST 1986


In article <3754 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
>> I also thought that casting anything into a (void*) would be a big
>> no-no.  Lint, and maybe even the compiler, would issue loud warnings
>> every time one tried to do this.
>> For some perverse reason that I have never been able to understand,
>> X3J11 decided that any pointer could be converted to (void*) without
>> complaint.

Ah, but if you have a function prototype such as:

	extern void free(void *);

and then try to free a pointer to a struct, you are implicitly casting
the struct pointer to a void *. Generating an error on this would
make void * fairly useless.



More information about the Comp.lang.c mailing list