]> git.ipfire.org Git - thirdparty/curl.git/commit
checksrc: reduce directory-specific exceptions
authorViktor Szakats <commit@vsz.me>
Thu, 2 Oct 2025 19:33:48 +0000 (21:33 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 3 Oct 2025 22:48:58 +0000 (00:48 +0200)
commit45438c8d6f8e70385d66c029568524e9e803c539
tree0833e8ef3252cc007def70fd2723d8ec49f91cd2
parentfff36a360ed781ff1073bfc918747828d57face2
checksrc: reduce directory-specific exceptions

By making them defaults, then fixing and/or reshuffling remaining
exceptions as necessary.

- checksrc: ban by default: `snprintf`, `vsnprintf`, `sscanf`, `strtol`.
- examples: replace `strtol` with `atoi` to avoid a checksrc exception.
- tests/libtest: replace `strtol` with `atol`.
- tests/server: replace most `strtol` with `atol`.
- tests/server: replace most `strtoul` with `atol`/`atoi`.
- tests/server: drop no longer used `util_ultous`.
- fix typo in checksrc rules: `vsnprint` -> `vsnprintf`.
- update local exceptions.

Also:
- examples: ban curl printf functions. They're discouraged in user code.
- examples: replace curl printf with system printf.
  Add `snprintf` workaround for <VS2015.
- examples/synctime: fix `-Wfloat-equal`.
- examples/synctime: exclude for non-Windows and non-UWP Windows.
- examples/synctime: build by default.

Closes #18823
36 files changed:
docs/examples/.checksrc
docs/examples/Makefile.inc
docs/examples/chkspeed.c
docs/examples/cookie_interface.c
docs/examples/http2-download.c
docs/examples/http2-serverpush.c
docs/examples/http2-upload.c
docs/examples/synctime.c
docs/internals/CODE_STYLE.md
lib/.checksrc
lib/curlx/.checksrc
lib/vauth/.checksrc
lib/vquic/.checksrc
lib/vssh/.checksrc
lib/vtls/.checksrc
scripts/checksrc.pl
src/.checksrc
tests/libtest/cli_hx_download.c
tests/libtest/cli_hx_upload.c
tests/libtest/cli_ws_data.c
tests/libtest/first.c
tests/libtest/lib1560.c
tests/libtest/lib1568.c
tests/libtest/lib521.c
tests/libtest/lib562.c
tests/libtest/lib591.c
tests/server/.checksrc
tests/server/dnsd.c
tests/server/first.h
tests/server/mqttd.c
tests/server/rtspd.c
tests/server/sockfilt.c
tests/server/socksd.c
tests/server/sws.c
tests/server/tftpd.c
tests/server/util.c