Skip to content

vquic: fix unused variable warning reported by clang-tidy#20752

Closed
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:vquic-unused
Closed

vquic: fix unused variable warning reported by clang-tidy#20752
vszakats wants to merge 1 commit intocurl:masterfrom
vszakats:vquic-unused

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Feb 27, 2026

Silencing (seen in new GHA/Linux H3 v20 job):

lib/vquic/vquic.c:398:37: error: variable 'calls' set but not used [clang-diagnostic-unused-but-set-variable]
  398 |   size_t total_nread = 0, pkts = 0, calls = 0;
      |                                     ^

Cherry-picked from #20751

Silencing (seen on Linux H3 v20 job):
```
lib/vquic/vquic.c:398:37: error: variable 'calls' set but not used [clang-diagnostic-unused-but-set-variable]
  398 |   size_t total_nread = 0, pkts = 0, calls = 0;
      |                                     ^
```

Cherry-picked from curl#20751
@vszakats vszakats added the build label Feb 27, 2026
@github-actions github-actions bot added the HTTP/3 h3 or quic related label Feb 27, 2026
@vszakats vszakats closed this in b2076d3 Feb 27, 2026
@vszakats vszakats deleted the vquic-unused branch February 27, 2026 01:41
vszakats added a commit that referenced this pull request Feb 27, 2026
`scan-build` is a (Perl) wrapper around clang's built-in `--analyze`
option. Which look similar or identical to clang-tidy checkers under
the `clang-analyzer-*` namespace:
https://clang.llvm.org/docs/ClangStaticAnalyzer.html

Unless somebody has other information, it appears redundant to run
scan-build in parallel with clang-tidy in CI, now that the latter is
working reliably and with good performance for all curl components.

Another scan-build issue is the lack of a markup to suppress false
positives. It ignores `NOLINT`, yet finds the same false positives as
clang-tidy. This happens with scan-build v20+. v18 is silent, but it's
a blocker to upgrade to a newer version.

scan-build may still be a useful when combined with autotools, where
clang-tidy support is incomplete, slow (no parallelism), and uses
a distinct make target, which does not build binaries in the same pass.
But, scan-build also lacks extra checkers that are now enabled for
clang-tidy.

The clang-tidy job is also 30-40s faster than the one it replaced.

Also:
- drop scan-build job configured the same way as a clang-tidy one.
  CI time saved: 6m30s
- bump to clang-20 (from 18) in the replacement job.
- build tests in the replacement job.
  To verify a cmake command-line reconstruction issue only hit in this
  job in CI.
  CI time cost: 1m40s
- replacement job caught a minor, new, issue.
  Ref: b2076d3 #20752
- drop unused scan-build logic.

Bug: #20732 (comment)
Ref: #20732 (comment)

Closes #20751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build HTTP/3 h3 or quic related

Development

Successfully merging this pull request may close these issues.

1 participant