(void *) ? /* again */
phil at ux1.cso.uiuc.edu
phil at ux1.cso.uiuc.edu
Fri Jan 19 21:48:12 AEST 1990
I have read (but I'm not sure where, I think it was in H&S) that when you
have the type (void *) then its effectively matches any pointer. For
instance, malloc is declared like:
void * malloc();
and you should be able to use it like:
long * plong;
plong = malloc( sizeof(long) );
But the compilers I have used so far all give warnings about this, saying
that the types are incompatible. Granted they are only warnings, and in
the case of unix, the -w flag will suppress them, I really WOULD like to see
other "legit" warnings.
Is this considered a "legit" warning?
Have I exceeded the bounds of C rules?
How can I suppress the "void" warnings and keep others w/o having to have
casts all over my code?
--Phil Howard, KA9WGN--
<phil at ux1.cso.uiuc.edu>
More information about the Comp.lang.c
mailing list