Skip to content

asyn-thrdd: fix clang-tidy unused value warning#21061

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:asyn-thrdd-warn
Closed

asyn-thrdd: fix clang-tidy unused value warning#21061
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:asyn-thrdd-warn

Conversation

@vszakats
Copy link
Copy Markdown
Member

with -DCURL_DISABLE_SOCKETPAIR=ON.

lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~

with `-DCURL_DISABLE_SOCKETPAIR=ON`.

```
lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~
```
@vszakats vszakats added the build label Mar 22, 2026
@github-actions github-actions bot added the name lookup DNS and related tech label Mar 22, 2026
@vszakats vszakats requested a review from Copilot March 22, 2026 12:46
Copy link
Copy Markdown

Copilot AI left a comment

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 fixes a clang-tidy dead-store warning in the threaded resolver when -DCURL_DISABLE_SOCKETPAIR=ON by adjusting preprocessor scoping so do_abort is only read when the socketpair-based wakeup path is compiled.

Changes:

  • Move the #ifndef CURL_DISABLE_SOCKETPAIR guard to cover the mutex-protected do_abort re-check used solely for wakeup signaling.
  • Prevent do_abort from being assigned in configurations where the value is never subsequently used.

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

@vszakats vszakats closed this in e8c64a0 Mar 22, 2026
@vszakats vszakats deleted the asyn-thrdd-warn branch March 22, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build name lookup DNS and related tech

Development

Successfully merging this pull request may close these issues.

2 participants