]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Makefile rule for static analyzer
authorMaria Matejka <mq@ucw.cz>
Wed, 14 Aug 2019 08:14:15 +0000 (10:14 +0200)
committerMaria Matejka <mq@ucw.cz>
Tue, 28 Apr 2020 14:21:06 +0000 (16:21 +0200)
Makefile.in

index e6dbd572fb53a0f854f2e43b084406fecdc2c8d1..cf94e35201aa7e9a5ac21f3b0d1637ad8155d589 100644 (file)
@@ -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]`