having "lint" check "printf" args (was Re: C Builtin Funxions)
guy at sun.UUCP
guy at sun.UUCP
Sat May 3 04:05:58 AEST 1986
> I've also heard that system 5 lint has (checking that the args to "printf"
> match the control string) built-in; there's even a directive
> /*PRINTFLIKE*/ so you can define your own.
Unfortunately, it doesn't. The "lint" library uses the directive, but the
"lint" processor doesn't implement it.
I've been tempted to implement it when I have the time; my notion was to
have pass 1 parse character string arguments and, if it discovers an
argument which is a valid "printf" control string (and isn't valid by being
a trivial control string with no "%<whatever>" items), it puts a list of the
expected argument types out in the file it hands to pass 2. It would also
not bother parsing subsequent character string arguments.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy at sun.arpa
More information about the Comp.lang.c
mailing list