Mike said:
'null pointer constant' and 'null pointer' are distinct
concepts.
Which is what I allude to above when I say: "Null pointer constants
might not be pointers".
I am not sure I agree to the fact that null pointer constants
are not pointers though.
It's an expression which has a pointer type. It's not
an object.
That much no one disagrees with.
True, but can it also be a value? Look at the description of
malloc for example: It returns a pointer.
"The malloc function returns either a null pointer or a pointer to the
allocated space."
So either the standard is wrong and malloc does not return a pointer,
or you are wrong and expressions can be pointers.
So if you are saying that only objects can be pointers I would like
to see chapter and verse please. Especially in the light of the fact
that object do not have types except when evaluated for their value.
(And then they _may_ be regarded as being of a particular type.)
IOW, talking about an object being and int or a pointer seems informal
in the first place.
Now, I have no problem seeing why some want to say that only objects
can be pointers. I only contend the claim that this is anything other
than an informal colloquioal distinction.
It's not. Expressions are not objects.
It's not an object, that much is clear. Only an idiot (or a newbie)
could think that it is. But still, the standard talks about functions
returning ints. So if you want to say that expression cannot evaluate
to int then I want to see chapter and verse.
I do.
There is a distinction between an object and an expression.
That's irrelevant here though. The disctinction was between
different types, not object versus expression. (For my very
last statement.)
And the overall discussion is not expression versus object either,
it is whether an expression can be something (in this case a pointer).