multi: silence gcc 16 -Wnull-dereference, bump CI job to test

- GHA/windows: bump dl-mingw job from gcc 15 to 16.

- multi: silence warning while building libcurlu:
  ```
  In function 'multi_ischanged',
      inlined from 'multi_socket.isra' at D:/a/curl/curl/lib/multi.c:3282:6:
  D:/a/curl/curl/lib/multi.c:1710:17: error: null pointer dereference [-Werror=null-dereference]
   1710 |   bool retval = (bool)multi->recheckstate;
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
  D:/a/curl/curl/lib/multi.c:1712:25: error: null pointer dereference [-Werror=null-dereference]
   1712 |     multi->recheckstate = FALSE;
        |                         ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/26217071531/job/77142119137?pr=21707

- multi: silence another `-Wnull-dereference`, popping up in libcurl
  with gcc 13 after the previous silencing:
  ```
  In function 'Curl_multi_xfers_running',
      inlined from 'multi_socket.isra' at ../../lib/multi.c:3292:28:
  ../../lib/multi.c:4132:15: error: null pointer dereference [-Werror=null-dereference]
   4132 |   return multi->xfers_alive;
        |          ~~~~~^~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/26218822231/job/77148186045

- multi: also add `DEBUGASSERT(multi)` to the two updated functions.

Closes #21707
This commit is contained in:
Viktor Szakats 2026-05-21 11:16:49 +02:00
parent 64c51ad178
commit a076f821e1
No known key found for this signature in database
2 changed files with 14 additions and 7 deletions

View file

@ -1707,9 +1707,13 @@ CURLMcode curl_multi_wakeup(CURLM *m)
*/
static bool multi_ischanged(struct Curl_multi *multi, bool clear)
{
bool retval = (bool)multi->recheckstate;
if(clear)
multi->recheckstate = FALSE;
bool retval = FALSE;
DEBUGASSERT(multi);
if(multi) {
retval = (bool)multi->recheckstate;
if(clear)
multi->recheckstate = FALSE;
}
return retval;
}
@ -4126,6 +4130,9 @@ struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi,
unsigned int Curl_multi_xfers_running(struct Curl_multi *multi)
{
DEBUGASSERT(multi);
if(!multi)
return 0;
return multi->xfers_alive;
}