K
Kaz Kylheku
Basically, yes. Except that this is done on an implementation where
unprototyped functions don't use the same calling convention as prototyped
variadic functions.
Then it isn't going to work. A conforming program will call printf as a
prototyped function, and the call will break due to different calling
conventions, right?
(And my point was that the standard might not
specifically disallow it, but if it doesn't, since the only way to use
The standard doesn't disallow broken, incomplete, or otherwise nonconforming
libraries. Such implementations can't claim to be conforming hosted
implementations, but at most conforming freestanding ones. They don't support
programs that require the features hosted implementations.
printf would be by avoiding <stdio.h> and the correct declaration, it
would be absurd for an implementation to try this.)
A program that calls printf other than using the correct declaration is
nonconforming. That the program has to do this in order to get the call
to work shows that the implementation is nonconforming.
The standard describes a protocol for calling printf, but this program and
implementation use a different arrangement. It si outside of the scope of the
standard language entirely.