Skip to content

clang-tidy: fix issues found with build-fuzzing#20774

Closed
vszakats wants to merge 6 commits intocurl:masterfrom
vszakats:ctidystress
Closed

clang-tidy: fix issues found with build-fuzzing#20774
vszakats wants to merge 6 commits intocurl:masterfrom
vszakats:ctidystress

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Feb 28, 2026

  • curl_sha512_256: add missing, drop redundant, parentheses.
  • doh: drop redundant returns.
  • url: add missing parentheses.
  • vtls: fix unused const variables.
  • tests/unit: fix missing header with clang-tidy and !threaded-resolver.
    Follow-up to 57ff2d6 dns: flatten the include tree #20106

  • postponed: multi: fix unreachable code warning.
    into a future PR to avoid a rebase conflict with the stacked PRs.
    (update is close to changed lines)

@github-actions github-actions bot added the tests label Feb 28, 2026
vszakats added 5 commits March 1, 2026 00:00
/lib/vtls/vtls.c:141:31: error: unused variable 'ALPN_SPEC_H2' [clang-diagnostic-unused-const-variable]
  141 | static const struct alpn_spec ALPN_SPEC_H2 = {
      |                               ^~~~~~~~~~~~
lib/vtls/vtls.c:144:31: error: unused variable 'ALPN_SPEC_H2_H11' [clang-diagnostic-unused-const-variable]
  144 | static const struct alpn_spec ALPN_SPEC_H2_H11 = {
      |                               ^~~~~~~~~~~~~~~~
lib/vtls/vtls.c:147:31: error: unused variable 'ALPN_SPEC_H11_H2' [clang-diagnostic-unused-const-variable]
  147 | static const struct alpn_spec ALPN_SPEC_H11_H2 = {
      |                               ^~~~~~~~~~~~~~~~
lib/doh.c:204:3: error: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow,-warnings-as-errors]
  204 |   return;
      |   ^~~~~~~
  205 | }
lib/doh.c:1194:3: error: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow,-warnings-as-errors]
 1194 |   return;
      |   ^~~~~~~
 1195 | }
Follow-up to 57ff2d6 curl#20106

Error while processing tests/unit/unit3216.c.
tests/unit/unit1607.c:150:40: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  150 |       if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen,
      |                                    ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit1607.c:150:55: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  150 |       if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen,
      |                                                   ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit1607.c:210:18: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  210 |       addr = addr->ai_next;
      |              ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit1609.c:149:40: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  149 |       if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen,
      |                                    ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit1609.c:149:55: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  149 |       if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen,
      |                                                   ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit1609.c:192:18: error: incomplete definition of type 'struct Curl_addrinfo' [clang-diagnostic-error]
  192 |       addr = addr->ai_next;
      |              ~~~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
tests/unit/unit2600.c:197:22: error: incomplete definition of type 'const struct Curl_addrinfo' [clang-diagnostic-error]
  197 |   ctx->ai_family = ai->ai_family;
      |                    ~~^
lib/hostip.h:57:10: note: forward declaration of 'struct Curl_addrinfo'
   57 |   struct Curl_addrinfo *addr;
      |          ^
@vszakats vszakats closed this in 35bbb2e Feb 28, 2026
@vszakats vszakats deleted the ctidystress branch February 28, 2026 23:04
vszakats added a commit to vszakats/curl that referenced this pull request Mar 2, 2026
```
lib/multi.c:305:5: error: code will never be executed [clang-diagnostic-unreachable-code]
  305 |     goto error;
      |     ^~~~~~~~~~
```

Cherry-picked from curl#20774
vszakats added a commit that referenced this pull request Mar 2, 2026
```
lib/multi.c:305:5: error: code will never be executed [clang-diagnostic-unreachable-code]
  305 |     goto error;
      |     ^~~~~~~~~~
```

Cherry-picked from #20774

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

Labels

Development

Successfully merging this pull request may close these issues.

1 participant