]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: fix the tidy targets for autotools
authorDaniel Stenberg <daniel@haxx.se>
Sun, 22 Dec 2024 23:04:35 +0000 (00:04 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 Dec 2024 22:03:10 +0000 (23:03 +0100)
To make them run clang-tidy correctly. clang-tidy occasionally finds
mistakes none of the other static code analyzers we use finds.

Also added the
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
flag, to make it not complain about memcpy()

"make tidy" in the build root works fine now. The previous clang-tidy CI
job was removed in e43c3b3e3e6c2d580. It is probably time to bring it
back.

Closes #15813

lib/Makefile.am
src/Makefile.am

index 74bff0e565447af983898185ebd4bf97bc16e7bd..2be8ba9e30c8f913120274386209980ebae551ed 100644 (file)
@@ -155,7 +155,7 @@ all-local: checksrc
 endif
 
 # disable the tests that are mostly causing false positives
-TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference -quiet
+TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -quiet
 
 TIDY:=clang-tidy
 
index 4fc7ef68cf18edd5e9061c1b657fa66d9350fec1..25f26dda6c02568d7b66799e91edb580cfc7b09d 100644 (file)
@@ -190,12 +190,12 @@ all-local: checksrc
 endif
 
 # disable the tests that are mostly causing false positives
-TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference
+TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -quiet
 
 TIDY:=clang-tidy
 
 tidy:
-       $(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
+       $(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) -DHAVE_CONFIG_H
 
 listhelp:
        (cd $(top_srcdir)/docs/cmdline-opts && make listhelp)