curl/tests/server
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 checksrc: use 'banfunc' proper in more places 2025-01-13 09:10:58 +01:00
.gitignore build: drop unused getpart tool 2025-02-25 01:52:13 +01:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt addrinfo: add curl macro to avoid redefining foreign symbols 2025-02-13 12:46:39 +01:00
disabled.c asyn-thread: use c-ares to resolve HTTPS RR 2025-01-25 23:46:14 +01:00
getpart.c build: set -O3 and tune WinCE in CI, fix getpart, vtls_scache fallouts 2025-02-26 21:23:11 +01:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am tests: fix enum/int confusion (Intel C), fix autotools CFLAGS for servers 2025-02-13 12:46:40 +01:00
Makefile.inc tidy-up: whitespace, tests/server Makefile.inc, timeval in VS project 2025-03-10 14:19:49 +01:00
mqttd.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
resolve.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
rtspd.c tests/server: sync wait_ms() with the libcurl implementation 2025-03-09 12:04:30 +01:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c tests/server: sync wait_ms() with the libcurl implementation 2025-03-09 12:04:30 +01:00
socksd.c tests/server: sync wait_ms() with the libcurl implementation 2025-03-09 12:04:30 +01:00
sws.c tidy-up: whitespace, tests/server Makefile.inc, timeval in VS project 2025-03-10 14:19:49 +01:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c build: enable -Wcast-qual, fix or silence compiler warnings 2025-03-10 22:30:15 +01:00
util.c tests/server: sync wait_ms() with the libcurl implementation 2025-03-09 12:04:30 +01:00
util.h tests/server: sync wait_ms() with the libcurl implementation 2025-03-09 12:04:30 +01:00