Path: utzoo!attcan!uunet!mcvax!ukc!stc!idec!prlhp1!yuleat From: yuleat@prlhp1.prl.philips.co.uk (yuleat) Newsgroups: comp.lang.c Subject: Compiler checking of printf() Keywords: ANSI standard, printf() Message-ID: <524@prlhp1.prl.philips.co.uk> Date: 13 Jul 88 08:40:43 GMT Organization: Philips Research Laboratories, Redhill, UK Lines: 18 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)