]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: fix clang-tidy builds to verify tests, fix fallouts
authorViktor Szakats <commit@vsz.me>
Mon, 17 Mar 2025 23:39:57 +0000 (00:39 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 24 Mar 2025 09:14:58 +0000 (10:14 +0100)
commit9465327084c920deee7ba5abbcd55dbec6cf3e95
tree4ebca64d82d4c84ae5f38578d1e24d7641ca265d
parentefa65b24ae22d8ae2798fb1a2b4cdc113270bdaf
cmake: fix clang-tidy builds to verify tests, fix fallouts

- cmake: disable test bundles for clang-tidy builds.
  clang-tidy ignores #included .c sources, and incompatible with unity
  and bundles. It caused clang-tidy ignoring all test sources. It also
  means this is the first time tests sources are checked with
  clang-tidy. (autotools doesn't run it on tests.)

- cmake: update description for `CURL_TEST_BUNDLES` option.

- fix tests using special `CURLE_*` enums that were missing from
  `curl/curl.h`. Add them as reserved codes.

- fix about ~50 other issues detected by clang-tidy: unchecked results,
  NULL derefs, memory leaks, casts to enums, unused assigments,
  uninitialized `errno` uses, unchecked `open`, indent, and more.

- drop unnecessary casts (lib1533, lib3207).

- suppress a few impossible cases with detailed `NOLINT`s.

- lib/escape.c: drop `NOLINT` no longer necessary.
  Follow-up to 72abf7c13a479edcde80afa60faad3f35f672c0b #13862 (possibly)

- extend two existing `NOLINT` comments with details.

Follow-up to fabfa8e4024473035b3e5c3c30c330be726d9bb4 #15825

Closes #16756
52 files changed:
CMakeLists.txt
docs/INSTALL-CMAKE.md
include/curl/curl.h
lib/cf-socket.c
lib/escape.c
lib/mprintf.c
lib/strerror.c
tests/CMakeLists.txt
tests/libtest/lib1301.c
tests/libtest/lib1501.c
tests/libtest/lib1517.c
tests/libtest/lib1518.c
tests/libtest/lib1533.c
tests/libtest/lib1538.c
tests/libtest/lib1559.c
tests/libtest/lib1560.c
tests/libtest/lib1597.c
tests/libtest/lib1905.c
tests/libtest/lib1911.c
tests/libtest/lib2302.c
tests/libtest/lib3026.c
tests/libtest/lib3207.c
tests/libtest/lib506.c
tests/libtest/lib507.c
tests/libtest/lib518.c
tests/libtest/lib537.c
tests/libtest/lib539.c
tests/libtest/lib540.c
tests/libtest/lib541.c
tests/libtest/lib557.c
tests/libtest/lib568.c
tests/libtest/lib569.c
tests/libtest/lib570.c
tests/libtest/lib572.c
tests/libtest/lib579.c
tests/libtest/lib590.c
tests/libtest/lib643.c
tests/libtest/lib654.c
tests/libtest/lib667.c
tests/libtest/lib694.c
tests/libtest/mk-lib1521.pl
tests/libtest/test.h
tests/server/rtspd.c
tests/server/sws.c
tests/test1119.pl
tests/test1477.pl
tests/unit/unit1300.c
tests/unit/unit1620.c
tests/unit/unit1654.c
tests/unit/unit1661.c
tests/unit/unit1663.c
tests/unit/unit3200.c