Skip to content

clang-tidy: enable more checks, fix fallouts - #20794

Closed
vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:clangtidymore2
Closed

vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:clangtidymore2

Conversation

@vszakats

@vszakats vszakats commented Mar 3, 2026 •

Copy link
Copy Markdown
Member
  • enable three checks:
    • bugprone-invalid-enum-default-initialization
    • bugprone-sizeof-expression
    • readability-inconsistent-declaration-parameter-name (strict)
  • fix remaining discrepancies with arg names in prototypes
    and implementation, in strict mode.
  • document reason for some checks tested but not enabled.

@vszakats
vszakats marked this pull request as draft March 4, 2026 04:01
@vszakats vszakats changed the title [TEST] clang-tidy: try more checks [WIP] clang-tidy: try more checks Mar 9, 2026
@vszakats
vszakats force-pushed the clangtidymore2 branch 3 times, most recently from 326112f to cddcdee Compare April 7, 2026 13:48
vszakats added a commit that referenced this pull request Apr 7, 2026
Also enable check in clang-tidy.

Cherry-picked from #20794

Closes #21256
@vszakats
vszakats marked this pull request as ready for review April 11, 2026 00:22
@vszakats vszakats changed the title [WIP] clang-tidy: try more checks clang-tidy: enable more checks, fix fallouts Apr 11, 2026
@vszakats vszakats closed this in df60148 Apr 14, 2026
@vszakats
vszakats deleted the clangtidymore2 branch April 14, 2026 00:21
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Also enable check in clang-tidy.

Cherry-picked from curl#20794

Closes curl#21256
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
- enable three checks:
  - bugprone-invalid-enum-default-initialization
  - bugprone-sizeof-expression
  - readability-inconsistent-declaration-parameter-name (strict)
- fix remaining discrepancies with arg names in prototypes
  and implementation, in strict mode.
- document reason for some checks tested but not enabled.

Closes curl#20794
vszakats pushed a commit that referenced this pull request Aug 17, 2026
Eleven arguments are named one way in the header and another in the
definition. the compiler only checks types so nothing is broken, but the
header is what people read first, and then the name changes under them
in the source:

```
curl_dbg_malloc          size     ->  wantedsize
curl_dbg_calloc          n, size  ->  wanted_elements, wanted_size
curl_dbg_realloc         size     ->  wantedsize
curl_dbg_strdup          src      ->  source
r_freeaddrinfo           res      ->  cahead
my_get_line              fp, db   ->  input, buf
curl_slist_append_ccsid  l        ->  list
curl_version_info_ccsid  cid      ->  ccsid
curl_easy_setopt_ccsid   curl     ->  easy
```

Follow-up to df60148 #20794

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

Development

Successfully merging this pull request may close these issues.

1 participant