]> git.ipfire.org Git - thirdparty/curl.git/commit
build: fix some `-Wsign-conversion`/`-Warith-conversion` warnings
authorViktor Szakats <commit@vsz.me>
Sat, 9 Dec 2023 02:45:19 +0000 (02:45 +0000)
committerViktor Szakats <commit@vsz.me>
Tue, 19 Dec 2023 12:45:28 +0000 (12:45 +0000)
commit2dbe75bd7f3c36837aa06fd87a442bdf3fb7faef
treec6d0f0aa822d4e036b4a2313089dfec9a8ad995e
parent68d80a8f9bf185f4aae1cfe0f5337f400afa6b6e
build: fix some `-Wsign-conversion`/`-Warith-conversion` warnings

- enable `-Wsign-conversion` warnings, but also setting them to not
  raise errors.
- fix `-Warith-conversion` warnings seen in CI.
  These are triggered by `-Wsign-converion` and causing errors unless
  explicitly silenced. It makes more sense to fix them, there just a few
  of them.
- fix some `-Wsign-conversion` warnings.
- hide `-Wsign-conversion` warnings with a `#pragma`.
- add macro `CURL_WARN_SIGN_CONVERSION` to unhide them on a per-build
  basis.
- update a CI job to unhide them with the above macro:
  https://github.com/curl/curl/actions/workflows/linux.yml -> OpenSSL -O3

Closes #12492
17 files changed:
.github/workflows/linux.yml
CMake/PickyWarnings.cmake
lib/curl_setup.h
lib/doh.c
lib/inet_pton.c
lib/mprintf.c
lib/share.c
lib/vauth/krb5_gssapi.c
lib/vauth/krb5_sspi.c
m4/curl-compilers.m4
tests/libtest/first.c
tests/libtest/lib1560.c
tests/libtest/lib1947.c
tests/libtest/testutil.c
tests/server/mqttd.c
tests/server/util.c
tests/unit/unit1651.c