]> git.mdlowis.com Git - projs/tide.git/commitdiff
added some static analysis hooks
authorMichael D. Lowis <mike.lowis@gentex.com>
Thu, 5 Apr 2018 16:04:16 +0000 (12:04 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Thu, 5 Apr 2018 16:04:16 +0000 (12:04 -0400)
Makefile
analyze.sh [new file with mode: 0755]

index 1f302313ded3a898094d541aa26b15cbac1ed9be..97a0d2322924b217ffabd663addf754c721b1c2b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ docs:
 clean:
        find . -name '*.[oad]' -delete
        find . \( -name '*.gcno' -o -name '*.gcda' \) -delete
-       $(RM) $(BINS) $(TEST_BINS)
+       $(RM) $(BINS) $(TEST_BINS) flaws.txt
 
 install:
        mkdir -p $(PREFIX)/bin
@@ -77,4 +77,9 @@ tests/pick: tests/pick.o libedit.a
 # load generate dependencies
 -include *.d lib/*.d tests/*.d tests/lib/*.d
 
+flaws:
+       -./analyze.sh tide.c lib/*.c
 
+scan-build:
+       make clean
+       scan-build make
diff --git a/analyze.sh b/analyze.sh
new file mode 100755 (executable)
index 0000000..14cd79b
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+(
+    flawfinder -DQSI -m 0 "$@" | tee flaws.txt
+       rats -i -lc -w 3 "$@"| tee -a flaws.txt
+) | grep '.\+:[0-9]\+'