Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Lint Message-ID: <2664@utcsri.UUCP> Date: Tue, 29-Apr-86 01:53:28 EDT Article-I.D.: utcsri.2664 Posted: Tue Apr 29 01:53:28 1986 Date-Received: Tue, 29-Apr-86 15:19:57 EDT Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 36 Keywords: lint varargs bug rotten Summary: VARARGS doesn't work 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