{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1738362046,"commit_time":1741642215,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"f4e23950c7b1c389cf0dde8b91353d85b8361b64","message":"build: enable `-Wcast-qual`, fix or silence compiler warnings\n\nThe issues found fell into these categories, with the applied fixes:\n\n- const was accidentally stripped.\n  Adjust code to not cast or cast with const.\n\n- const/volatile missing from arguments, local variables.\n  Constify arguments or variables, adjust/delete casts. Small code\n  changes in a few places.\n\n- const must be stripped because an API dependency requires it.\n  Strip `const` with `CURL_UNCONST()` macro to silence the warning out\n  of our control. These happen at API boundaries. Sometimes they depend\n  on dependency version, which this patch handles as necessary. Also\n  enable const support for the zlib API, using `ZLIB_CONST`. Supported\n  by zlib 1.2.5.2 and newer.\n\n- const must be stripped because a curl API requires it.\n  Strip `const` with `CURL_UNCONST()` macro to silence the warning out\n  of our immediate control. For example we promise to send a non-const\n  argument to a callback, though the data is const internally.\n\n- other cases where we may avoid const stripping by code changes.\n  Also silenced with `CURL_UNCONST()`.\n\n- there are 3 places where `CURL_UNCONST()` is cast again to const.\n  To silence this type of warning:\n  ```\n  lib/vquic/curl_osslq.c:1015:29: error: to be safe all intermediate\n    pointers in cast from 'unsigned char **' to 'const unsigned char **'\n    must be 'const' qualified [-Werror=cast-qual]\n  lib/cf-socket.c:734:32: error: to be safe all intermediate pointers in\n    cast from 'char **' to 'const char **' must be 'const' qualified\n    [-Werror=cast-qual]\n  ```\n  There may be a better solution, but I couldn't find it.\n\nThese cases are handled in separate subcommits, but without further\nmarkup.\n\nIf you see a `-Wcast-qual` warning in curl, we appreciate your report\nabout it.\n\nCloses #16142\n","parents":["8b1b5cd4d2df3a8c2c0108d1d2b5d519b7ece23e"],"tree_hash":"1c16f8cc20253a4317ad6b282604b7796fe29372"}