Subject: Re: Adding syscall argument checking to lint?
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Alan Barrett <firstname.lastname@example.org>
Date: 10/04/1995 14:52:02
On Mon, 2 Oct 1995, Jonathan Stone suggested:
> /* SYSCALL struct svr4_fcntl_args */
> svr4_fcntl(p, v, retval)
> register struct proc *p;
> void *v;
> register_t *retval;
> where the appropriate test for lint to apply is that the second
> argument to the function after the SYSCALL comment -- in this case, v
> -- is _declared_ as a void* but _used_ as (or assigned to) a pointer
> to whatever-type-it-is that follows the SYSCALL.
If somebody does teach lint that new trick, please make it more general.
Perhaps something like this:
svr4_fcntl(p, v, retval)
register struct proc *p;
/* USEDAS struct svr4_fcntl_args * */
where the USEDAS lint directive means that, although `v' is declared as
type `void *', it should be type checked in many respects as if it were
of type `struct svr4_fcntl_args *'.
--apb (Alan Barrett)