Compiler checking of printf()

yuleat yuleat at prlhp1.prl.philips.co.uk
Wed Jul 13 18:40:43 AEST 1988


Having used a reasonable variety of C compilers in the past few
years, I was somewhat surprised recently by a warning message I
received from the ANSI (yes, I know the standard isn't finished
yet) C compiler I have for my home computer (an Acorn Archimedes).
After a bit of testing, I found that not only would it issue a
warning if the wrong number of arguments were passed to printf(),
but it also checked that the types of the arguments matched the
specifiers in the format string.

Is this part of the standard? If not, is it a particularly novel
feature?
This behaviour implies to me, that the printf() command is broken
down by the compiler to produce (at least partly) in-line code,
is this likely/reasonable?

(As an aside, the compiler is very good value for c. 100 quid.
 My thanks to messers Mycroft & Norman - the authors)



More information about the Comp.lang.c mailing list