(void *) ? /* again */

Woodrow Baker woody at rpp386.cactus.org
Sun Jan 21 15:53:51 AEST 1990


In article <6200009 at ux1.cso.uiuc.edu>, phil at ux1.cso.uiuc.edu writes:
> 
> 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:

I believe in the new ANSI standard it is called a "generic" pointer, but
I'm not certain, as I don't have my Standards draft notes handy.  A nice
little book from PLUM HALL, written by Thomas Plum.  Well worth the $10.00e

you might try something like


#define void int

I have seen some code done this way in order to make it compatible
with a compiler that did not support void.
Watch it carefully however.  Make certain that ints are what you want.
e
> How can I suppress the "void" warnings and keep others w/o having to have
> casts all over my code?
Cheers
Woody



More information about the Comp.lang.c mailing list