From: Michael D. Lowis Date: Thu, 5 Apr 2018 16:04:16 +0000 (-0400) Subject: added some static analysis hooks X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=f22ace6d18f2591634dd64a343fd8eae45af3dfc;p=projs%2Ftide.git added some static analysis hooks --- diff --git a/Makefile b/Makefile index 1f30231..97a0d23 100644 --- 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 index 0000000..14cd79b --- /dev/null +++ b/analyze.sh @@ -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]\+'