Commit 59a86cbc authored by Maria Matejka's avatar Maria Matejka
Browse files

Makefile rule for static analyzer

parent 3c838ad9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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]`