From f22ace6d18f2591634dd64a343fd8eae45af3dfc Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 5 Apr 2018 12:04:16 -0400 Subject: [PATCH] added some static analysis hooks --- Makefile | 7 ++++++- analyze.sh | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100755 analyze.sh 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]\+' -- 2.51.0