[splint-discuss] Variable argument type checking

Michael Wojcik Michael.Wojcik at MicroFocus.com
Tue Mar 17 07:17:53 PST 2009


> From: splint-discuss-bounces at cs.virginia.edu [mailto:splint-discuss-
> bounces at cs.virginia.edu] On Behalf Of jhanley at dgtlrift.com
> Sent: Tuesday, 17 March, 2009 10:43
> 
> I guess my example was a little vague. What I mean to explain is that
> the above be in some header file and that when argument one is a value
> of 0 or 4, there are no other arguments, when it is a value of 1 the
> next should be of type const char *, when it is a value of 2 the next
> argument should be of type const this_struct_type *, etc.  What I was
> hoping for was the ability to annotate to splint as to the legal ways
> this function can be called so it can inform the user of the function
> if there are any calls that don't match the argument pattern
described.

That would be a rather complex annotation language. For it to handle all
the possible semantics of variadic functions, it'd have to be as
powerful as C.

Splint does have an extension mechanism that's as powerful as C: you
download the Splint source, modify it to do what you want, and recompile
it.

Short of that, no, you can't teach Splint how your variadic functions
work.

-- 
Michael Wojcik
Principal Software Systems Developer, Micro Focus




More information about the splint-discuss mailing list