#! /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