curl-curl/lib/vtls
Viktor Szakats f4e23950c7
build: enable -Wcast-qual, fix or silence compiler warnings
The issues found fell into these categories, with the applied fixes:

- const was accidentally stripped.
  Adjust code to not cast or cast with const.

- const/volatile missing from arguments, local variables.
  Constify arguments or variables, adjust/delete casts. Small code
  changes in a few places.

- const must be stripped because an API dependency requires it.
  Strip `const` with `CURL_UNCONST()` macro to silence the warning out
  of our control. These happen at API boundaries. Sometimes they depend
  on dependency version, which this patch handles as necessary. Also
  enable const support for the zlib API, using `ZLIB_CONST`. Supported
  by zlib 1.2.5.2 and newer.

- const must be stripped because a curl API requires it.
  Strip `const` with `CURL_UNCONST()` macro to silence the warning out
  of our immediate control. For example we promise to send a non-const
  argument to a callback, though the data is const internally.

- other cases where we may avoid const stripping by code changes.
  Also silenced with `CURL_UNCONST()`.

- there are 3 places where `CURL_UNCONST()` is cast again to const.
  To silence this type of warning:
  ```
  lib/vquic/curl_osslq.c:1015:29: error: to be safe all intermediate
    pointers in cast from 'unsigned char **' to 'const unsigned char **'
    must be 'const' qualified [-Werror=cast-qual]
  lib/cf-socket.c:734:32: error: to be safe all intermediate pointers in
    cast from 'char **' to 'const char **' must be 'const' qualified
    [-Werror=cast-qual]
  ```
  There may be a better solution, but I couldn't find it.

These cases are handled in separate subcommits, but without further
markup.

If you see a `-Wcast-qual` warning in curl, we appreciate your report
about it.

Closes #16142
2025-03-10 22:30:15 +01:00
..
.checksrc strparse: switch to curl_off_t as base data type 2025-02-15 21:58:48 +01:00
bearssl.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
bearssl.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
cipher_suite.c vtls: fix compiler warnings seen with gcc 7.3.0 and mbedTLS 2025-03-07 15:43:00 +01:00
cipher_suite.h rustls: add support for setting TLS version and ciphers 2024-08-16 09:55:02 +02:00
gtls.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
gtls.h wolfssl: tls early data support 2025-02-24 10:01:51 +01:00
hostcheck.c code: language cleanup in comments 2024-07-01 22:58:55 +02:00
hostcheck.h code: language cleanup in comments 2024-07-01 22:58:55 +02:00
keylog.c lib: use bool/TRUE/FALSE properly 2024-10-03 09:31:56 +02:00
keylog.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
mbedtls_threadlock.c mbedtls: properly cleanup the thread-shared entropy 2024-03-12 03:09:37 -04:00
mbedtls_threadlock.h tidy-up: one comment and EOF newlines 2024-03-12 15:38:44 +00:00
mbedtls.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
mbedtls.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
openssl.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
openssl.h OpenSSL/quictls: add support for TLSv1.3 early data 2025-03-03 09:27:04 +01:00
rustls.c rustls: add support for CERTINFO 2025-02-25 07:59:39 +01:00
rustls.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
schannel_int.h schannel: fix TLS cert verification by IP SAN 2024-10-31 08:59:37 +01:00
schannel_verify.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
schannel.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
schannel.h msvc: add missing push/pop for warning pragmas 2025-01-27 20:59:47 +01:00
sectransp.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
sectransp.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
vtls_int.h vtls: move common early data code into vtls.c 2025-02-26 16:00:37 +01:00
vtls_scache.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
vtls_scache.h build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
vtls_spack.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
vtls_spack.h build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
vtls.c shutdowns: split shutdown handling from connection pool 2025-03-02 11:13:34 +01:00
vtls.h lib: TLS session ticket caching reworked 2024-12-20 14:59:23 +01:00
wolfssl.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
wolfssl.h wolfssl: tls early data support 2025-02-24 10:01:51 +01:00
x509asn1.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
x509asn1.h rustls: add support for CERTINFO 2025-02-25 07:59:39 +01:00