Lint

Gregory Smith greg at utcsri.UUCP
Tue Apr 29 15:53:28 AEST 1986


Somebody was complaining that they couldn't get /* VARARGS */ to work in
lint. Well I ran into the same problem, and guess what, VARARGS does not do
what it says:
----------- part of man lint: ------------------
     /*VARARGSn*/
          suppresses the usual checking for variable numbers of
          arguments in the following function declaration.  The
          data types of the first n arguments are checked; a
          missing n is taken to be 0.

----------- part of /usr/lib/lint/llib-lc: --------
	/* VARARGS */
	printf( s ) char *s; {;}

------------- dammit.c --------------
main(){
	int i;
	i=0;
	printf(i);
}
------------- lint dammit.c:---------
dammit.c:
printf, arg. 1 used inconsistently	llib-lc(276)  ::  dammit.c(4)
---------------------------------------
/* VARARGS */ and /*VARARGS0*/ both cause the first arg to be type-checked.
Another 'bug' is that /* VARARGS */ is used for all varargs functions in
llib-lc, where VARARGS1 should be used for printf, VARARGS2 for sprintf and
fprintf, etc. grumble, grumble.

Neither problem is mentioned in the BUGS section of man LINT.
This is 4.2 BSD.

-- 
"For every action there is an equal and opposite malfunction"
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg



More information about the Comp.lang.c mailing list