Skip to content

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

Closed
vszakats wants to merge 6 commits into
curl:masterfrom
vszakats:gcc16
Closed

multi: silence gcc 16 -Wnull-dereference, bump CI job to test#21707
vszakats wants to merge 6 commits into
curl:masterfrom
vszakats:gcc16

Conversation

@vszakats

@vszakats vszakats commented May 21, 2026

Copy link
Copy Markdown
Member
  • 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.

@vszakats vszakats marked this pull request as draft May 21, 2026 09:17
@vszakats vszakats changed the title try gcc 16.1.0 [WIP] try gcc 16.1.0 May 21, 2026
@github-actions github-actions Bot added Windows Windows-specific CI Continuous Integration labels May 21, 2026
@vszakats vszakats force-pushed the gcc16 branch 2 times, most recently from db1835b to 6b8afd8 Compare May 21, 2026 09:46
vszakats added 2 commits May 21, 2026 12:22
```
In file included from D:/a/curl/curl/bld/lib/CMakeFiles/curlu.dir/Unity/unity_0_c.c:259:
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;
      |                         ^
```
https://github.com/curl/curl/actions/runs/26217071531/job/77142119137?pr=21707
```
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;
      |          ~~~~~^~~~~~~~~~~~~
```
https://github.com/curl/curl/actions/runs/26218822231/job/77148186045
@vszakats vszakats changed the title [WIP] try gcc 16.1.0 multi: silence gcc 16 -Wnull-dereference, bump CI job to test May 21, 2026
@vszakats vszakats marked this pull request as ready for review May 21, 2026 10:35
@vszakats vszakats requested a review from Copilot May 21, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates libcurl’s multi interface implementation and Windows CI to address GCC -Wnull-dereference warnings (treated as errors) and to ensure CI exercises the newer compiler/toolchain where the warnings occur.

Changes:

  • Guard multi_ischanged() and Curl_multi_xfers_running() against NULL to silence GCC -Wnull-dereference, and add DEBUGASSERT(multi) in both.
  • Bump the Windows “dl-mingw” CI job toolchain to w64devkit v2.8.0 / GCC 16.1.0.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/multi.c Adds DEBUGASSERT and NULL guards to silence GCC null-dereference warnings in inlined multi codepaths.
.github/workflows/windows.yml Updates the w64devkit download/version/SHA used by the dl-mingw job to test with GCC 16.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/multi.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@vszakats vszakats closed this in a076f82 May 21, 2026
@vszakats vszakats deleted the gcc16 branch May 21, 2026 13:17
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
- 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 curl#21707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants