On 3/03/2011, at 6:14 AM, Derek M Jones wrote:
As a compiler writer I don't regard printf as being part of the language
but as part of the library.

Note however that there are C compilers which, given a call to
{sn,s,f,}printf() with a string literal for the format, will
check that the following arguments conform in number and type
to what the format expects.  This is enormously helpful for the

For the last 20 years or so my company has sold a tool that
allows developers to specify the name of a function (user defined
or otherwise) and various properties about its arguments and
return value, these are used to check the source during compilation.

Over the last few years data mining tools have started to be used
to extract ordering dependencies for user defined functions which
can then be checked at compile time.

The only reason that C library functions tend to be checked before
user defined functions is that it requires less work from the
compiler implementor.

Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd       
Source code analysis         

The Open University is incorporated by Royal Charter (RC 000391), an exempt charity 
in England & Wales and a charity registered in Scotland (SC 038302).

Reply via email to