How to let lint check your format strings

Guy Harris guy at sun.uucp
Thu Apr 11 16:55:18 AEST 1985


> The idea of having lint use constant format strings to check types and
> arg counts is a great one.  I have wanted to do this for many years as
> argument types and counts for printf and its buddies are one of my more
> frequent errors.  Could we come up with a system that does not require any
> includes or modifications to the code to do it?  This would be great!

Somebody did - AT&T to be specific.  The system is called "UNIX System V
Release 2".  "lint" was enhanced with a /*PRINTFLIKE*/ pragma; it's like
/*VARARGS*/, only it declares the routine as being like "printf".  The
argument list is checked against the format string.

	Guy Harris
	sun!guy



More information about the Comp.lang.c mailing list