void * compatibility

Karl Heuer karl at haddock.ima.isc.com
Thu Sep 20 13:44:38 AEST 1990


In article <8770 at b11.ingr.com> polfer at b11.ingr.com (? Polfer) writes:
>    int (**command)();
>    *command = NULL;
>    "Type `void *' is not assignment compatible with type `int (*)()'."
>isn't a "void *" supposed to be assignment compatible with ALL pointers?

No, it's compatible with all *data* pointers.  Function pointers need not fit
in a `void *'.

But (as Chris Torek already pointed out), a null pointer constant is a special
case.  Your compiler has a bug in that it apparently fails to recognize the
`(void *)0' form as a null pointer constant.

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.lang.c mailing list