Chapter and verse please, assuming that p is of type char * and
that a valid printf prototype is in scope.
For those who don't remember the previous discussions on this
topic, here's the relevant C&V.
N869 6.2.5
[#15] The three types char, signed char, and unsigned char
are collectively called the character types. The
implementation shall define char to have the same range,
representation, and behavior as either signed char or
unsigned char.
N869 6.2.5
[#27] A pointer to void shall have the same representation
and alignment requirements as a pointer to a character type.
Now, the wording of #27 is ambiguous, because of the use of the
word "a". For example, consider the following English sentences:
"A tin of food can feed a dog."
"I have a dog."
In the first case, "a" means "any" -- any tin of food can feed any
dog at all. In the second case, "a" means "some particular one" --
I have *one* dog. It's *not* true that for any dog at all, I have
it!
So we have the ambiguity. Either #27 means
A pointer to void [is basically interchangeable with]
a pointer to any character type at all
or else it means
A pointer to void [is basically interchangeable with]
a pointer to some particular [unspecified] character type
Obviously, the two interpretations lead to different results in
this case; if (void *) and (char *) have the same representation,
then printf("%p", cptr) is well-defined, and if they don't (e.g.,
if (void *) and (unsigned char *) have the same representation,
and char is signed), then printf("%p", p) is undefined.
I don't know what has been done since N869 to disambiguate this
section.
-Arthur