R
Richard Heathfield
Is it legal to assign NULL to a function pointer?
I believe it is, because of {3.3(C89)|6.5(C99)}.16.1, Constraint #5:
* the left operand is a pointer and the right is a null pointer
constant.
(it doesn't say "object pointer", just "pointer"), but nevertheless I am
mildly nervous.
If necessary, I could do this:
void null(void);
#define FUNCTION_NULL null
but I'd rather avoid that if I can, because I'd have to add a cast to
just about every usage thereof.
I believe it is, because of {3.3(C89)|6.5(C99)}.16.1, Constraint #5:
* the left operand is a pointer and the right is a null pointer
constant.
(it doesn't say "object pointer", just "pointer"), but nevertheless I am
mildly nervous.
If necessary, I could do this:
void null(void);
#define FUNCTION_NULL null
but I'd rather avoid that if I can, because I'd have to add a cast to
just about every usage thereof.