From 59a86cbc7c5d5640b16ca9d8a99be979b11a4c68 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 14 Aug 2019 10:14:15 +0200 Subject: [PATCH] Makefile rule for static analyzer --- Makefile.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile.in b/Makefile.in index e6dbd572..cf94e352 100644 --- a/Makefile.in +++ b/Makefile.in @@ -184,6 +184,14 @@ check: tests tests_run tests: $(tests_targets) tests_run: $(tests_targets_ok) +STATIC_CHECKERS := nullability.NullableDereferenced nullability.NullablePassedToNonnull nullability.NullableReturnedFromNonnull optin.portability.UnixAPI valist.CopyToSelf valist.Uninitialized valist.Unterminated +STATIC_SCAN_FLAGS := --force-analyze-debug-code -o $(objdir)/static-scan/ $(addprefix -enable-checker ,$(STATIC_CHECKERS)) + +static-scan: + $(E)echo Running static code analysis + $(Q)$(MAKE) clean + $(Q)scan-build $(STATIC_SCAN_FLAGS) $(MAKE) -$(MAKEFLAGS) + tags: cd $(srcdir) ; etags -lc `find $(dirs) -name *.[chY]`