lint -I

John Canning john at banzai.UUCP
Fri Apr 22 23:55:55 AEST 1988


I hate to spoil the fun of blaming AT&T for lint -I/foobar/include
not working the way you want it to, but if you make your $SHELL
variable use /bin/sh instead of /bin/ksh, it works quite nicely.

The ksh interprets one of the lines inside the lint script a tad
differently than sh would.  This has something to do with the way
it handles backslashes inside of single vs. double quotes.

If you want to make lint work properly when run under the korne shell,
change line 55 so that it reads as follows (this will work for ksh
as well as sh):

			O=`echo $OPT | sed "s/\\(.\\).*/\\1/p"`

The original line used single quotes in place of double quotes.


    In case you want more detail as to what this line does, or
    where it really is, keep reading...


    The line appears in a case statement which tries to parse out
    the options.  When it finds a -, it starts to look for
    another ONE character option.  Under the ksh, the line is
    interpreted so that the sed script looks for the next word,
    rather than just the next character.  Changing the single
    quotes to double quotes will make the ksh work correctly.

    Here is the original line in context:

	case "$OPT" in
	*.c)	FILES="$FILES $OPT"	NDOTC="x$NDOTC";;
	*.ln)	FILES="$FILES $OPT";;
	-*)	OPT=`echo $OPT | sed s/-//p`
		while [ "$OPT" ]
		do
			O=`echo $OPT | sed 's/\\(.\\).*/\\1/p'`
			OPT=`echo $OPT | sed s/.//p`
			case $O in
			p)	LINTF="$LINTF -p"
			.
			.
			.
    
I hope this clears up the confusion over lint and its bugs...

John Canning
The People's Computer Company
Burlington, Vermont



More information about the Comp.sys.att mailing list