summaryrefslogtreecommitdiff
path: root/lint/fl
blob: d9e7505374d67ca10319e1a7381f71bc5cf12537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/sh

# Script to run Gimpel's flexlint program.

f()
{
	flexelint_binary +fll \
	    "-e506" \
	    "-e613" \
	    "-e717" \
	    "-e773" \
	    "-e774" \
	    "-e801" \
	    "-e818" \
	    "-e826" \
	    "-emacro(737,WT_ALIGN)" \
	    "-emacro(776,WT_ALIGN)" \
	    "-emacro(776,WT_OVERFLOW_BYTES_TO_FRAGS)" \
	    "-esym(534,fprintf,memcpy,memset)" \
	    "-function(exit,__wt_abort)" \
	    "-libdir(.)" \
	    "-libdir(../inc_posix)" \
	    "-wlib(0)" \
	     "-i../build_posix" "-i../inc_posix" "-i/usr/include" $1
}

update=0
while :
	do case "$1" in
	-u)
		update=1
		shift;;
	*)
		break;;
	esac
done

# List of source files.
l="../btree/*.c ../db/*.c ../env/*.c ../os_posix/*.c ../support/*.c"

# Don't lint all of them.
l=`echo $l |
    sed -e 's/\.\.\/support\/simple_setup.c//'`
l=`ls $l`

if [ $# -ne 0 ]; then
	f "$*"
else
	f "$l" > lint.tmp 2>&1

	if test "$update" -eq 1; then
		cp lint.tmp lint.current
	elif test -f "lint.current"; then
		cmp lint.tmp lint.current > /dev/null 2>&1 ||
		    (echo '<<< Current Tree		>>> Previous Tree'; \
		    diff lint.tmp lint.current) | more
	else
		more lint.tmp
	fi
fi

exit 0