>
> Since I agree with the above in its entirety, I'm trying to find what
> part of my post prompted the "No".
You said: "pointers *may* have different representations from integers", I
said: "pointers have the *same* representation as integers". Pointers are
just a bunch of bits with value 0 or 1 (assuming a binary machine, for other
kinds the discussion is similar). That is the same as a representation of
integers. A major difference is that the arithmetic on pointers can be
different from the arithmetic on integers. And I explicitly did qualify
my meaning.
> If it was my use of "integers" as
> opposed to "int types" or "integer types", I consider that an OK thing
> to do, since one, it's clear what is meant by context, and two, even
> the Standard says "integer promotions" as opposed to "integer type
> promotions" (that's only the first example that came to mind).
But still in that case, the "representation" is the same, if the machine
does not use (for instance) ternary for pointers and binary for integers,
but although I know ternary machines did exist, they did not do that. But
it need not necessarily fit in size.
And the "representation" was what the OP asked about. In both cases the
representation is a bunch of bits and you can assign 1 to one bit, 2 to the
next, 4 to the following, and so on. The next question was whether there was
a different format involved, I tried to answer that question by showing two
cases where adding 1 to a pointer in integer arithmetic does not necessarily
give the next cell. But the question itself was indeed not clear enough.
We can ask of course whether the OP meant "value" rather than "representation".
This reminds me of a discussion I earlier had in this newsgroup on what was
meant with a pointer with value 0. On (for instance) the transputer, address
0 is a perfectly valid address, as is -1 and -2 and so on. The address
ranges from -k to +l for some suitable values of k and l. So the question
was actually was the value of that pointer something that (in C) compared
equal to 0 or was it something that held the actual value 0. But apparently
this distinction was lost.
There are lots of weird machines around. I have used a machine where the
all zero bits floating point number was the unnormalised version of 0.0.
Adding 0.5 to it would result in 0.0. If you wish I can explain.
Formerly in this newsgroup the attitude that pointers worked like integers
was "all the computers are a Vax". That made porting programs to other
machines sometimes a crime. I have been involved in porting a derivate of
the Bourne shell (the whole world is Vax) to a Cray-1. A basic assumption
in that program that int-pointers would have lower bit equal to 0 is false
on that machine. Porting that program to e.g. the Data General would have
shown similar problems (for other reasons).
Yes, I have programmed a lot of weird machines, and for that reason I strictly
follow the rules the standard gives (I hope).