splint-support-20030701
authorR. Lindsay Todd <toddr@rpi.edu>
Wed, 2 Jul 2003 02:03:17 +0000 (02:03 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 2 Jul 2003 02:03:17 +0000 (02:03 +0000)
FIXES 1493

add splint support targets to makefiles
add support files

acinclude.m4
configure.in
src/helper-splint.sh.in [new file with mode: 0644]
src/splint.cfg [new file with mode: 0644]
src/util/Makefile.in
src/viced/Makefile.in
src/vol/Makefile.in
src/volser/Makefile.in

index 1fcc527..58e1667 100644 (file)
@@ -883,5 +883,10 @@ if test "${DEST}x" = "x"; then
         DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest"
 fi
 
+HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh"
+HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg"
+AC_SUBST(HELPER_SPLINT)
+AC_SUBST(HELPER_SPLINTCFG)
+
 
 ])
index dfce048..a200c7f 100644 (file)
@@ -123,4 +123,5 @@ src/vol/test/Makefile \
 src/volser/Makefile \
 src/wsadmin.src/Makefile \
 src/xstat/Makefile \
+src/helper-splint.sh \
 )
diff --git a/src/helper-splint.sh.in b/src/helper-splint.sh.in
new file mode 100644 (file)
index 0000000..3745995
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+# Invoke "splint" with common options.
+#
+# This uses a common splint.cfg file.  It will also look for a
+# splint.cfg file in the current directory, using that instead, or a
+# splint-append.cfg file, using that in addition to the common
+# configuration.
+
+
+TOP_SRCDIR=@TOP_SRCDIR@
+HELPER_SPLINTCFG=@HELPER_SPLINTCFG@
+
+cfargs="-f ${HELPER_SPLINTCFG}"
+#
+if [ -r splint-append.cfg ]; then
+    echo "Appending contents of splint-append.cfg to common splint options."
+    cfargs="$cfargs -f splint-append.cfg"
+elif [ -r splint.cfg ]; then
+    echo "Overriding common splint options with splint.cfg"
+    cfargs="-f splint.cfg"
+else
+    echo "No splint-append.cfg or splint.cfg, so using only common options."
+fi
+#
+# Now run splint.
+exec splint $cfargs -bad-flag "$@"
diff --git a/src/splint.cfg b/src/splint.cfg
new file mode 100644 (file)
index 0000000..f672f76
--- /dev/null
@@ -0,0 +1,17 @@
+# We only attempt weak checking.
+-weak
+#
+# We are not using namespaces the way splint wants, so don't check.
+-name-checks
+#
+# Standard Unix library.
++unix-lib
+#
+# On RedHat Linux 9, /usr/include/asm/types.h uses __signed__ keyword.
+-D__signed__=signed
+#
+# Stop complaining that sizes of array parameters are ignored.
+-fixed-formal-array
+#
+# Flags to control checking integer usage.
++match-any-integral
index ce90a01..8a59f06 100644 (file)
@@ -7,6 +7,8 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+HELPER_SPLINT=@HELPER_SPLINT@
+
 
 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
         hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
@@ -369,8 +371,8 @@ dest: \
        ${DEST}/lib/afs/libafsutil.a \
        ${DEST}/bin/sys
 
-splint:
-       splint $(CFLAGS) \
+check-splint:
+       sh $(HELPER_SPLINT) $(CFLAGS) \
            assert.c base64.c casestrcpy.c ktime.c volparse.c hostparse.c \
            hputil.c kreltime.c isathing.c get_krbrlm.c uuid.c serverLog.c \
            dirpath.c fileutil.c netutils.c flipbase64.c \
index 1fb303d..349e0c0 100644 (file)
@@ -7,6 +7,7 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+HELPER_SPLINT=@HELPER_SPLINT@
 
 
 CFLAGS=${DBG} ${OPTMZ} -I${TOP_OBJDIR}/src/config -I. -I${TOP_INCDIR} \
@@ -122,8 +123,8 @@ ${TOP_INCDIR}/afs/fs_stats.h: fs_stats.h
 
 dest:    ${DEST}/root.server/usr/afs/bin/fileserver ${DEST}/include/afs/fs_stats.h
 
-splint::
-       splint $(CFLAGS) \
+check-splint::
+       sh $(HELPER_SPLINT) $(CFLAGS) \
            viced.c             \
            afsfileprocs.c      \
            host.c              \
index 506e61e..1f733fb 100644 (file)
@@ -7,6 +7,8 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+HELPER_SPLINT=@HELPER_SPLINT@
+
 
 LIBS=${TOP_LIBDIR}/libcmd.a vlib.a ${TOP_LIBDIR}/util.a \
        ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdir.a \
@@ -280,8 +282,8 @@ dest: \
        ${DEST}/include/afs/ihandle.h \
        ${DEST}/include/afs/namei_ops.h
 
-splint::
-       splint $(CFLAGS) \
+check-splint::
+       sh $(HELPER_SPLINT) $(CFLAGS) \
            vnode.c volume.c vutil.c partition.c fssync.c purge.c \
            clone.c nuke.c devname.c listinodes.c common.c ihandle.c \
            namei_ops.c \
index e89a8bf..f5d6db9 100644 (file)
@@ -7,6 +7,8 @@
 
 srcdir=@srcdir@
 include @TOP_OBJDIR@/src/config/Makefile.config
+HELPER_SPLINT=@HELPER_SPLINT@
+
 
 VINCLS=${TOP_INCDIR}/afs/partition.h ${TOP_INCDIR}/afs/volume.h \
        ${TOP_INCDIR}/afs/vlserver.h vol.h dump.h volser.h  lockdata.h
@@ -179,8 +181,8 @@ dest: \
        ${DEST}/lib/afs/libvolser.a
 
 
-splint::
-       splint $(CFLAGS) \
+check-splint::
+       sh $(HELPER_SPLINT) $(CFLAGS) \
            vos.c restorevol.c \
            vsprocs.c vsutils.c lockprocs.c volerr.c \
            volmain.c volprocs.c physio.c common.c voltrans.c \