Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site kovacs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!randvax!kovacs!day From: day@kovacs.UUCP (Dave Yost) Newsgroups: net.sources Subject: nicer lint output for cheap Message-ID: <264@kovacs.UUCP> Date: Mon, 30-Sep-85 02:52:57 EDT Article-I.D.: kovacs.264 Posted: Mon Sep 30 02:52:57 1985 Date-Received: Sat, 5-Oct-85 02:25:56 EDT Organization: Robt Abel & Assoc, Hollywood Lines: 96 If you have old-style lint (v7, 4.2bsd), you may have noticed as I have that the output from pass2 is a jumble. After years of living with this, it dawned on me that I could fix it without source. I modified the /usr/bin/lint shell script to run pass2 through a new filter called lint3 (which is also a shell script). And here they are now: # This is a shell archive. Remove anything before this line, then # unpack it by saving it in a file and typing "sh file". (Files # unpacked will be owned by you and have default permissions.) # # This archive contains: # usr/bin/lint usr/lib/lint/lint3 echo x - usr/bin/lint cat > "usr/bin/lint" << '//E*O*F usr/bin/lint//' #! /bin/sh # # @(#)SHELL 1.5 (Berkeley) 4/9/83 # $(@)modified to do lint3 fixup pass -- d yost 8/1/85 # L=/usr/lib/lint/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix LL=/usr/lib/lint C= W=fixup trap "rm -f $T ${T}2 ${T}3 ; exit" 1 2 15 for A in $* do case $A in -*n*) P= ;; -*p*) P=port ;; esac case $A in *.ln) cat $A >>$T ;; -l*) cat $LL/llib$A.ln >>$T ;; -C?*) W=-C P= C=`echo $A | sed -e s/-C/llib-l/` ; X="$X -L -C$C" ;; -[IDOU]*) O="$O $A" ;; # -X) LL=/usr/scj/lint L=/usr/scj/lint/lpass ;; -X) LL=/usr/src/usr.bin/lint L=/usr/src/usr.bin/lint/lpass ;; -F) W=normal ;; -*) X="$X $A" ;; *) echo "$A:" ; (/lib/cpp $O $A | ${L}1 $X >>$T)2>&1 esac done case $P in unix) cat $LL/llib-lc.ln >>$T ;; port) cat $LL/llib-port.ln >>$T ;; "") cat /dev/null >>$T ;; esac case $W in fixup) ${L}2 $T $X > ${T}2 ; ${L}3 ${T}2 ${T}3 ;; -C) cp $T $C.ln ;; *) ${L}2 $T $X ;; esac rm -f $T ${T}2 ${T}3 //E*O*F usr/bin/lint// echo x - usr/lib/lint/lint3 cat > "usr/lib/lint/lint3" << '//E*O*F usr/lib/lint/lint3//' #!/bin/sh # # fixup pre-sys3 lint output -- Dave Yost 8/1/85 # TMP=$2 fgrep -v 'multiply declared used inconsistently variable # of args value declared inconsistently value is used, but none returned always ignored sometimes ignored but not defined but never used' $1 fgrep 'multiply declared used inconsistently variable # of args value declared inconsistently value is used, but none returned always ignored sometimes ignored but not defined but never used' $1 > $TMP echo if fgrep 'multiply declared' $TMP | sort ; then echo ; fi if fgrep 'used inconsistently' $TMP | sort ; then echo ; fi if fgrep 'variable # of args' $TMP | sort ; then echo ; fi if fgrep 'value declared inconsistently' $TMP | sort ; then echo ; fi if fgrep 'value is used, but none returned' $TMP | sort ; then echo ; fi if fgrep 'always ignored' $TMP | sort ; then echo ; fi if fgrep 'sometimes ignored' $TMP | sort ; then echo ; fi if fgrep 'but not defined' $TMP | sort ; then echo ; fi fgrep 'but never used' $TMP | sort ; //E*O*F usr/lib/lint/lint3// exit 0 Brought to you by Super Global Mega Corp .com