Skip to content

Commit 9c52dd1

Browse files
bagderpps83
authored andcommitted
build: fix the tidy targets for autotools
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 e43c3b3. It is probably time to bring it back. Closes curl#15813
1 parent 18fa8c2 commit 9c52dd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ all-local: checksrc
155155
endif
156156

157157
# disable the tests that are mostly causing false positives
158-
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
158+
TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -quiet
159159

160160
TIDY:=clang-tidy
161161

src/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ all-local: checksrc
190190
endif
191191

192192
# disable the tests that are mostly causing false positives
193-
TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference
193+
TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling -quiet
194194

195195
TIDY:=clang-tidy
196196

197197
tidy:
198-
$(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
198+
$(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) -DHAVE_CONFIG_H
199199

200200
listhelp:
201201
(cd $(top_srcdir)/docs/cmdline-opts && make listhelp)

0 commit comments

Comments
 (0)