Subject: bin/4266: lint shipped with NetBSD 1.2 is unusable
To: None <>
From: Peter Simons <>
List: netbsd-bugs
Date: 10/13/1997 11:56:21
>Number:         4266
>Category:       bin
>Synopsis:       lint shipped with NetBSD 1.2 is unusable
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 13 03:05:01 1997
>Originator:     Peter Simons
>Release:        1.2
System: NetBSD/i386 1.2

	The lint version that comes with NetBSD/i386 1.2 is pretty
	unusable for two reasons:

  	a) It is not installed completely.
	b) It is obviously a rather old version that issues a lot of
	   warnings that are not suitable today anymore.

	and related to b): It issues lots of warnings when checking
	the normal include files.

	An example program:

	| #include <stdio.h>
	| #include <string.h>
	| int
	| main(int argc, char ** argv)
	| {
	|     if (argc <= 1) {
	| 	printf("Usage: %s string\n", argv[0]);
	| 	exit(1);
	|     }
	|     printf("Length is %d characters.\n", strlen(argv[1]));
	|     return 0;
	| }

	If this program is fed through lint, the following warnings
	are given:

	| simons@peti:/tmp$ lint -g test.c
	| test.c:
	| types.h(45): warning: integral constant too large
	| types.h(49): warning: integral constant too large
	| stdio.h(133): warning: integral constant too large
	| stdio.h(134): warning: integral constant too large
	| lint: cannot find llib-lc.ln
	| Lint pass2:
	| exit used( test.c(9) ), but not defined
	| printf used( test.c(8) ), but not defined
	| strlen used( test.c(12) ), but not defined

	The "integral constant too large" warning comes from defining
	an array as 'char buffer[2]' instead of using:

	#define TWO 2
	char buffer[TWO];

	which is rather mystic.

	Furthermore, the llib-lc.ln library is obviously missing.

	Last but not least, it is hard to see why lint complaines
	about printf() not being defined, if there's a big, far
	include stdlib.h.

	Update to the latest version of lint.