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
This commit is contained in:
Viktor Szakats 2025-10-02 21:33:48 +02:00
parent fff36a360e
commit 45438c8d6f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
36 changed files with 124 additions and 142 deletions

View file

@ -53,11 +53,15 @@ my %banfunc = (
"gets" => 1,
"strtok" => 1,
"sprintf" => 1,
"snprintf" => 1,
"vsprintf" => 1,
"vsnprintf" => 1,
"sscanf" => 1,
"strcat" => 1,
"strncat" => 1,
"strncpy" => 1,
"strtok_r" => 1,
"strtol" => 1,
"strtoul" => 1,
"_mbscat" => 1,
"_mbsncat" => 1,