Is void *p = 0L valid?
- by Artefacto
In this answer, sassman initializes a pointer with:
zend_class_entry* ce = 0L;
My question is – is this valid? I would say it isn't, to initialize the variable with a null pointer either an unadorned (and possibly casted to
void *) 0 constant, or some macro that evaluates to that such as NULL should be used.
However, I can't find definitive language in the standard that supports this interpretation. All it says is:
An integer constant expression with the value 0, or such an expression cast to type
void *, is called a null pointer constant.