R
Richard Bos
Jack Klein said:But in the particular case of an argument to *printf() to match a "%p"
conversion specifier, compatibility is guaranteed by specific wording
in the standard by 6.5.2.2 p6.
Is it? How? AFAICT, what that guarantees is that in the program in
question - which did not declare printf() - the call to printf() in its
entirety has undefined behaviour. Because what it says is:
# If the expression that denotes the called function has a type that
# does not include a prototype...
(which is the case here), and:
# If the function is defined with a type that includes a prototype, and
# either the prototype ends with an ellipsis (,...)...
(which is also the case here), then:
# the behavior is undefined.
IYAM, this takes precedence over the _following_ sentence which states
that an _explicit_ void * declared parameter is compatible with a char *
argument. In fact, since the expected void * is not _declared_ in the
printf() prototype, that sentence does not even apply.
Richard