Gabriel Dos Reis wrote:

you can (equality) compare a pointer to NULL -- which does not even
happen to designate an object.
Well accurately, you can compare pointers, its not illegal, but the result of
comparing pointers to separately allocated objects is undefined.

[...]

| One way to think about the semantic model is to consider pointers
| in C to consist of a base/offset pair, where the base points to the
| start of the object (some debugging checkout C compilers even
| use such a format). Then operations on pointers need ONLY
| reference the offset.

that model is too simplistic -- hint: null pointers.
null is a special case indeed, which can be reprsented using a distinguished offset

-- Gaby



Reply via email to