]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
8 weeks agoTODO: drop the alt-svc fallback
Daniel Stenberg [Mon, 2 Mar 2026 08:09:10 +0000 (09:09 +0100)] 
TODO: drop the alt-svc fallback

Let's return to this subject if someone actually needs this for their
specific use case.

See #17152
Closes #20786

8 weeks agotest1637: verify --fail and --retry with 502 response code
Daniel Stenberg [Sun, 1 Mar 2026 12:21:11 +0000 (13:21 +0100)] 
test1637: verify --fail and --retry with 502 response code

It should exit with 22 after the second retry.

Ref: #20771
Cloes #20780

8 weeks agoHISTORY: mention that Rafael passed away much too early
Daniel Stenberg [Sun, 1 Mar 2026 12:40:06 +0000 (13:40 +0100)] 
HISTORY: mention that Rafael passed away much too early

Closes #20781

8 weeks agoGHA: bump actions and pip dependencies
dependabot[bot] [Sun, 1 Mar 2026 14:58:16 +0000 (14:58 +0000)] 
GHA: bump actions and pip dependencies

- update action `actions/cache` from 5.0.1 to 5.0.3
- update action `github/codeql-action` from 4.31.9 to 4.32.4
- update pip `filelock` from 3.20.3 to 3.24.3
- update pip `ruff` from 0.14.14 to 0.15.2

Closes #20782
Closes #20783

8 weeks agocmake: rename `testbins` target to `tt`, restore internal option
Viktor Szakats [Sat, 28 Feb 2026 00:33:05 +0000 (01:33 +0100)] 
cmake: rename `testbins` target to `tt`, restore internal option

To make it easy to type. The internal option is used in CI.

Follow-up to aae361242f30eafacf46085ed731b1524bfd3be9 #20708

Closes #20768

8 weeks agoGHA/windows: bump clang-tidy job to clang v20 (from v18)
Viktor Szakats [Sat, 28 Feb 2026 22:53:08 +0000 (23:53 +0100)] 
GHA/windows: bump clang-tidy job to clang v20 (from v18)

Adds 50 seconds to the 5m long build step. Also more prerequisites to
install, with no apparent effect on step time.

Follow-up to 9b52d516bb8990107f20c9786e09dbb6961c30b2 #20732

Closes #20775

8 weeks agoclang-tidy: fix issues found with build-fuzzing
Viktor Szakats [Sat, 28 Feb 2026 21:41:23 +0000 (22:41 +0100)] 
clang-tidy: fix issues found with build-fuzzing

- 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 57ff2d6c918d0bb444e5a8a53405217aec116b1b #20106

Closes #20774

8 weeks agoclang-tidy: silence more minor issues found by v22
Viktor Szakats [Sat, 28 Feb 2026 10:29:16 +0000 (11:29 +0100)] 
clang-tidy: silence more minor issues found by v22

Also one found manually in lib/curl_sha512_256.c.

Follow-up to 7a08c5d820fcf237688562a237a05000214db789 #20762

Closes #20770

8 weeks agodocs: some nitpicks
Florian Imdahl [Thu, 26 Feb 2026 18:48:57 +0000 (19:48 +0100)] 
docs: some nitpicks

- replaced double spaces with single space where applicable
- replaced "favourite" with "favorite"
- added language identifiers to code blocks in markdown files
- added extra line after code blocks and after headings in markdown
  files

Cloes #20748

8 weeks agoINSTALL.md: fix typo
Daniel Stenberg [Fri, 27 Feb 2026 21:29:09 +0000 (22:29 +0100)] 
INSTALL.md: fix typo

Reported-by: Nathan-M-code on github
Fixes #20766
Closes #20767

8 weeks agoappveyor: minor improvements [ci skip]
Viktor Szakats [Thu, 26 Feb 2026 23:03:18 +0000 (00:03 +0100)] 
appveyor: minor improvements [ci skip]

- make per-job cmake options override default ones (as in GHA)
- also upload `.lib` artifacts (in commented code)

Cherry-picked from #20750

8 weeks agoldap: silence clang-tidy v22 warning
Viktor Szakats [Fri, 27 Feb 2026 14:03:28 +0000 (15:03 +0100)] 
ldap: silence clang-tidy v22 warning

Closes #20762

8 weeks agomprintf: use `_snprintf()` when compiled with VS2013 and older
Viktor Szakats [Thu, 26 Feb 2026 23:38:07 +0000 (00:38 +0100)] 
mprintf: use `_snprintf()` when compiled with VS2013 and older

To support floats and doubles when using these old compilers.

Before this patch, these tests most likely failed with them:
```
FAIL 557: 'curl_mprintf() testing' printf, unittest
FAIL 566: 'HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes transfer' HTTP, HTTP GET
FAIL 599: 'HTTP GET with progress callback and redirects changing content sizes' HTTP, HTTP POST, chunked Transfer-Encoding
FAIL 1148: 'progress-bar' HTTP, progressbar
```

Also:
- mention `_snprintf()` in the `_CRT_SECURE_NO_WARNINGS` comment.

Follow-up to 7de35515d90d364e851cdde712062b942d6bf36a #20218

Closes #20761

8 weeks agocmake: convert `curl_add_clang_tidy_test_target()` macro to function
Viktor Szakats [Fri, 27 Feb 2026 12:43:51 +0000 (13:43 +0100)] 
cmake: convert `curl_add_clang_tidy_test_target()` macro to function

I thought a macro is necessary to have `get_directory_property()` and
`CMAKE_CURRENT_SOURCE_DIR` work on the correct directory, but it turns
out they do work the same when used in a function.

Closes #20760

8 weeks agocmake: replace `list(FIND)` with `if(var IN_LIST list)`
Viktor Szakats [Fri, 27 Feb 2026 11:03:32 +0000 (12:03 +0100)] 
cmake: replace `list(FIND)` with `if(var IN_LIST list)`

Available since CMake v3.3.

Ref: https://cmake.org/cmake/help/latest/command/if.html#in-list

Closes #20758

8 weeks agoGHA/linux: replace scan-build with clang-tidy
Viktor Szakats [Fri, 27 Feb 2026 00:09:14 +0000 (01:09 +0100)] 
GHA/linux: replace scan-build with clang-tidy

`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: b2076d3c2f5386068d9b0199f25a81147784d8ac #20752
- drop unused scan-build logic.

Bug: https://github.com/curl/curl/pull/20732#issuecomment-3963873838
Ref: https://github.com/curl/curl/pull/20732#issuecomment-3967479228

Closes #20751

8 weeks agocmake: fix system include directory position for clang-tidy in tests
Viktor Szakats [Fri, 27 Feb 2026 03:08:06 +0000 (04:08 +0100)] 
cmake: fix system include directory position for clang-tidy in tests

To avoid a system include masking a custom directory, and e.g. picking
up system OpenSSL headers from `/usr/include` on Linux, instead of the
correct ones from a custom header directory, move system include
directories to the back of the header path list. Also to match what
CMake seems to be doing for the C compiler command-lines it generates.

CMake seems to use `-I`, while for these invocations we stick with
`-isystem` just in case.

This area remains fragile and likely not the final issue.

Fixing (seen in GHA/linux H3 c-ares):
```
Error while processing bld/tests/libtest/lib1521.c.
/usr/include/openssl/macros.h:147:4: error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level" [clang-diagnostic-error]
Found compiler error(s).
  147 | #  error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
      |    ^
FAILED: [code=1] tests/libtest/CMakeFiles/libtests-clang-tidy
```
Ref: https://github.com/curl/curl/actions/runs/22468472670/job/65079885471?pr=20751

Bug: https://github.com/curl/curl/pull/20751#issuecomment-3970180687
Cherry-picked from #20751

Closes #20759

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 27 Feb 2026 08:37:29 +0000 (09:37 +0100)] 
RELEASE-NOTES: synced

2 months agocfilter: move a debug-only check into ifdef DEBUGBUILD
Daniel Stenberg [Fri, 27 Feb 2026 06:59:10 +0000 (07:59 +0100)] 
cfilter: move a debug-only check into ifdef DEBUGBUILD

Pointed out by CodeSonar

Closes #20756

2 months agoftp: remove two redundant assignments
Daniel Stenberg [Fri, 27 Feb 2026 06:54:58 +0000 (07:54 +0100)] 
ftp: remove two redundant assignments

Follow-up to 29bca12978f3ad

Pointed out by CodeSonar

Closes #20755

2 months agovquic: fix unused variable warning reported by clang-tidy
Viktor Szakats [Fri, 27 Feb 2026 00:33:08 +0000 (01:33 +0100)] 
vquic: fix unused variable warning reported by clang-tidy

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

Closes #20752

2 months agoclang-tidy: add missing and delete redundant parentheses
Viktor Szakats [Thu, 26 Feb 2026 20:36:59 +0000 (21:36 +0100)] 
clang-tidy: add missing and delete redundant parentheses

Reported by clang-tidy v22.1.0.

Ref: https://releases.llvm.org/22.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html

Closes #20749

2 months agomailmap: Hamza Bensliman
Daniel Stenberg [Thu, 26 Feb 2026 19:01:02 +0000 (20:01 +0100)] 
mailmap: Hamza Bensliman

2 months agocmake: fix confusing error when a dependency is undetected in `curl-config.cmake`
Viktor Szakats [Thu, 26 Feb 2026 11:35:51 +0000 (12:35 +0100)] 
cmake: fix confusing error when a dependency is undetected in `curl-config.cmake`

Fixing:
```
CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
  get_target_property() called with non-existent target "CURL::libssh2".
```
and replacing it with the clearer message:
```
CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
  The link interface of target "CURL::libcurl_static" contains:

    CURL::libssh2

  but the target was not found.  Possible reasons include:
[...]
```

Reported-by: Val S.
Ref: #20729
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20737

2 months agoGHA/linux: delete unused autotools clang-tidy logic
Viktor Szakats [Thu, 26 Feb 2026 18:26:37 +0000 (19:26 +0100)] 
GHA/linux: delete unused autotools clang-tidy logic

Follow-up to 26eddf002f0d9e957ff21865bddfbdf25b4521f5 #20725

Closes #20747

2 months agoGHA/macos: bump runner to macos-26 in clang-tidy jobs
Viktor Szakats [Thu, 26 Feb 2026 17:28:30 +0000 (18:28 +0100)] 
GHA/macos: bump runner to macos-26 in clang-tidy jobs

Tiny difference in practice:
Apple clang 17.0.0.17000013 -> 17.0.0.17000603

To use the most recent tools for static analyses.

Closes #20745

2 months agoGHA/linux: enable clang-tidy for docs/examples
Viktor Szakats [Thu, 26 Feb 2026 16:17:19 +0000 (17:17 +0100)] 
GHA/linux: enable clang-tidy for docs/examples

Also:
- imap-append: silence false positive (seen on Linux only).
  Follow-up to b1f853a3849d0e8116ae4e2aedfb9ca65f92282d #20731
  Follow-up to 725c5609aef19ba53373a49386cd979006b590d6 #20723

Closes #20743

2 months agoGHA/macos: drop unused `install_step` values [ci skip]
Viktor Szakats [Thu, 26 Feb 2026 18:12:14 +0000 (19:12 +0100)] 
GHA/macos: drop unused `install_step` values [ci skip]

2 months agortsp: fix assertion failure on zero-length RTP payload
hamza [Thu, 26 Feb 2026 16:36:24 +0000 (16:36 +0000)] 
rtsp: fix assertion failure on zero-length RTP payload

Fixes #20735
Reported-by: David Korczynski
Closes #20744

2 months agoGHA: update ngtcp2/ngtcp2 to v1.21.0
renovate[bot] [Thu, 26 Feb 2026 12:40:43 +0000 (12:40 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.21.0

Closes #20738

2 months agomulti: avoid a theoretical 32-bit wrap
Daniel Stenberg [Thu, 26 Feb 2026 15:58:15 +0000 (16:58 +0100)] 
multi: avoid a theoretical 32-bit wrap

If Curl_uint32_tbl_count() at some future point actually can return
UINT_MAX, this fixes the math to not wrap.

Closes #20742

2 months agoGHA/linux: bump sanitizer jobs to clang v20 (from v18)
Viktor Szakats [Thu, 26 Feb 2026 03:53:30 +0000 (04:53 +0100)] 
GHA/linux: bump sanitizer jobs to clang v20 (from v18)

To use the newest version offered by the runner's Ubuntu 24.04.

Ref: https://packages.ubuntu.com/search?suite=noble-updates&keywords=clang

Closes #20732

2 months agoGHA/macos: update comment about macOS targets vs. features
Viktor Szakats [Thu, 26 Feb 2026 14:18:13 +0000 (15:18 +0100)] 
GHA/macos: update comment about macOS targets vs. features

Closes #20741

2 months agocmake: silence potential unused var warnings in C++ test snippet
Viktor Szakats [Thu, 26 Feb 2026 11:31:55 +0000 (12:31 +0100)] 
cmake: silence potential unused var warnings in C++ test snippet

Follow-up to 6ad50dc2859e9ea764aafe51b34d430a663fb1d3 #20687

Closes #20736

2 months agoVULN-DISCLOSURE-POLICY.md: use hackerone
Daniel Stenberg [Mon, 23 Feb 2026 10:31:18 +0000 (11:31 +0100)] 
VULN-DISCLOSURE-POLICY.md: use hackerone

- bug_report.yml: use hackerone

Closes #20683

2 months agoGHA/linux: switch clang-tidy job to cmake for 2x speed, bump to v20, enable for tests
Viktor Szakats [Wed, 25 Feb 2026 14:51:59 +0000 (15:51 +0100)] 
GHA/linux: switch clang-tidy job to cmake for 2x speed, bump to v20, enable for tests

Checking lib and src under 3m15s versus 7m15s.

Downside: autotools clang-tidy support is no longer CI-tested.

The reason for the slowness is invoking a single clang-tidy command with
all source files, and clang-tidy checking them in a single thread,
sequentially. clang-tidy offers a `run-clang-tidy` Python script for
parallel  processing, which may help with this. However at this point
it's more practical to use cmake, which also supports verifying the
whole codebase, not only lib and src.

Also:
- bump clang-tidy to the latest available, v20 (from v18).
- enable running clang-tidy on tests. Takes under 2 minutes.

Also tried `_CURL_TESTS_CONCAT=ON`, it brings down the build tests step
from 1m47s to 54s, saving 1 minute. Skipped using it for now.

Closes #20725

2 months agoclang-tidy: enable scanning headers
Viktor Szakats [Wed, 25 Feb 2026 14:01:47 +0000 (15:01 +0100)] 
clang-tidy: enable scanning headers

By setting `HeaderFilterRegex: '.*'`.

Closes #20720

2 months agounit3205: suppress two clang-tidy false positives
Viktor Szakats [Thu, 26 Feb 2026 02:56:36 +0000 (03:56 +0100)] 
unit3205: suppress two clang-tidy false positives

Silencing:
```
tests/unit/unit3205.c:565:32: error: the result from calling 'memcpy' is not null-terminated [bugprone-not-null-terminated-result]
  565 |         expect = (const char *)memcpy(alt, "DHE-", 4);
      |                                ^~~~~~            ~~~
      |                                strcpy
tests/unit/unit3205.c:569:32: error: the result from calling 'memcpy' is not null-terminated [bugprone-not-null-terminated-result]
  569 |         expect = (const char *)memcpy(alt + 4, "DHE-", 4) - 4;
      |                                ^~~~~~                ~~~
      |                                strcpy
```
Ref: https://github.com/curl/curl/actions/runs/22425366818/job/64932197466?pr=20725

Cherry-picked from #20725

Closes #20731

2 months agotests/server: fix to clear the complete `srvr_sockaddr_union_t` variable
Viktor Szakats [Thu, 26 Feb 2026 02:28:17 +0000 (03:28 +0100)] 
tests/server: fix to clear the complete `srvr_sockaddr_union_t` variable

Reported by clang-tidy (seen on Linux with v18, v19, v20, not on macOS):
```
tests/server/dnsd.c:552:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/dnsd.c:556:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/rtspd.c:1183:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/rtspd.c:1187:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/sws.c:2235:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/sws.c:2239:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/tftpd.c:1188:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/tftpd.c:1192:14: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/util.c:860:21: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
tests/server/util.c:864:21: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
```
Ref: https://github.com/curl/curl/actions/runs/22424827575/job/64930560425?pr=20725

Cherry-picked from #20725

Closes #20730

2 months agobuild: add missing `GENERATEDCERTS` files
Viktor Szakats [Thu, 26 Feb 2026 01:45:52 +0000 (02:45 +0100)] 
build: add missing `GENERATEDCERTS` files

Also alpha sort lists, while here.

Follow-up to 2cf19c245eff8ff84e53d6edc27d36bf25439d1b #17493

Closes #20728

2 months agocmake: minor fixes to test targets after prev
Viktor Szakats [Thu, 26 Feb 2026 01:11:36 +0000 (02:11 +0100)] 
cmake: minor fixes to test targets after prev

- run tests-clang-tidy when building testbins.
- drop redundant build-certs dependency for test targets.
  Already present via testdeps.

Follow-up to aae361242f30eafacf46085ed731b1524bfd3be9 #20708

Closes #20727

2 months agobuild: do not include wolfSSL header in `curl_setup.h`
Viktor Szakats [Wed, 25 Feb 2026 19:55:03 +0000 (20:55 +0100)] 
build: do not include wolfSSL header in `curl_setup.h`

To fix building tests/server with cmake and both wolfSSL and OpenSSL
enabled (MultiSSL).

tests/server do not have libcurl dependency header paths setup because
it does not use libcurl. The code however includes `curl_setup.h`, which
tried including `wolfssl/version.h` before this patch to verify if the
wolfSSL coexist feature is available. Without a header path, it failed:
```
In file included from bld/tests/server/servers.c:3:
In file included from tests/server/first.h:40:
lib/curl_setup.h:737:12: fatal error: 'wolfssl/version.h' file not found
  737 | #  include <wolfssl/version.h>
      |            ^~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/22410066319/job/64880787424#step:46:76

Fix by moving the include and version check to `vtls/wolfssl.c`.

Also: add an early version check to cmake.

Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973
Cherry-picked from #20720

Closes #20726

2 months agocmake: replace internal option with a new `testbins` target
Viktor Szakats [Tue, 24 Feb 2026 00:35:02 +0000 (01:35 +0100)] 
cmake: replace internal option with a new `testbins` target

To allow building test binaries without test certs, replacing
`_CURL_SKIP_BUILD_CERTS` internal option with a build target that is
similar to `testdeps`, but without building the test certificates.

To make building test binaries a little bit faster, with less noisy
output, and without having to reconfigure the build.

Closes #20708

2 months agocmake: fix passing system header directories to clang-tidy for tests
Viktor Szakats [Wed, 25 Feb 2026 17:18:02 +0000 (18:18 +0100)] 
cmake: fix passing system header directories to clang-tidy for tests

Pass system directories with `-isystem` to avoid clang-tidy parsing
3rd-party and system headers with `HeaderFilterRegex: '.*' enabled.

Also:
- drop rule exception no longer necessary.
- sync normal vs. system header path order with compiler invocation.
- tidy up `set()` syntax.
- clear a temporary variable.

Bug: https://github.com/curl/curl/pull/20670#issuecomment-3940840176
Follow-up to e088e104549421914da9170eeead72a43d42c028 #17705
Cherry-picked from: #20720

Closes #20724

2 months agoclang-tidy: avoid/silence `bugprone-not-null-terminated-result`
Viktor Szakats [Wed, 25 Feb 2026 17:32:14 +0000 (18:32 +0100)] 
clang-tidy: avoid/silence `bugprone-not-null-terminated-result`

Prefer `sizeof()` over `strlen()`, static const variables over macros.
Add a couple of `NOLINT`s to silence false positives.

Also sync similar code patterns between libtests.

Cherry-picked from #20720

Closes #20723

2 months agocmake: add native clang-tidy support for tests, with concatenated sources
Viktor Szakats [Sat, 21 Feb 2026 01:44:42 +0000 (02:44 +0100)] 
cmake: add native clang-tidy support for tests, with concatenated sources

Tests are build in "unity"-style, by including sources into an umbrella
C files (similar to how CMake unity works). This does not play well with
clang-tidy, which seems to unconditionally ignore C sources included
like this. To fix it, curl's CMake implements a manual clang-tidy
support for tests, which  compiles sources one-by-one, while also making
sure sources compile cleanly standalone (e.g. all sources need to
include `first.h`). The manual clang-tidy implementation is fragile, and
performance, in particular when targeting Windows, is abysmal.

This patch introduces an alternate solution, enabled by the
`_CURL_TESTS_CONCAT=ON` option. In this mode, umbrella sources include
the actual sources instead of `#including` them. Allowing to use CMake's
built-in clang-tidy support to compile them, with clang-tidy actually
checking the sources. Making the manual clang-tidy support unnecessary.
In the Windows CI job it results in a 4x performance improvement (4m ->
1m), making it practical to run clang-tidy on tests on Windows, in CI.

The main downside is that clang-tidy doesn't understand the `#line`
directive. Meaning issues found show the wrong filename and line number
next to them. It's not impossible to locate errors this way, but also
not convenient.

Minor/potential downside is that the concatenated source needs to be
reassembled each time an original source is updated. This may result in
more copying on the disk when used in local development. The largest
source is 1.4MB, so probably not a show-stopper on most machines.

Another is the complexity of maintaining two methods in parallel, which
may be necessary till clang-tidy understands `#line`:
https://github.com/llvm/llvm-project/issues/62405

This solution may in theory also enable adding clang-tidy support for
tests in autotools, though I haven't tried.

Targeted for curl CI for now, and used in a GHA/windows job. 100%
experimental, not recommended outside these.

Closes #20667

2 months agoclang-tidy: add more missing parentheses in macro values
Viktor Szakats [Wed, 25 Feb 2026 14:06:27 +0000 (15:06 +0100)] 
clang-tidy: add more missing parentheses in macro values

Reported when running `HeaderFilterRegex: '.*'` in CI.

Also replace an underscored symbol with a regular one in macro
definition.

Cherry-picked from #20720

Closes #20721

2 months agoclang-tidy: enable more checks
Viktor Szakats [Wed, 18 Feb 2026 23:16:24 +0000 (00:16 +0100)] 
clang-tidy: enable more checks

Refs:
https://clang.llvm.org/extra/clang-tidy/checks/list.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assert-side-effect.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/chained-comparison.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/dynamic-static-initializers.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-repeated-side-effects.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-operator-in-strlen-in-alloc.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-pointer-arithmetic-in-alloc.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/not-null-terminated-result.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/posix-return.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-enum-usage.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-memset-usage.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-missing-comma.html
https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-semicolon.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-declaration.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-function-ptr-dereference.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-parentheses.html

Closes #20622

2 months agotidy-up: miscellaneous
Viktor Szakats [Fri, 13 Feb 2026 00:47:10 +0000 (01:47 +0100)] 
tidy-up: miscellaneous

- vms/curlmsg_vms.h: delete unused/commented code.
- vtls/schannel_verify: sort includes.
- typecheck-gcc.h: fix indent and alignment.
- lib/config-win32.h: drop idle `#undef`.
- spacecheck: check for stray empty lines before after curly braces.
- make literals more readable: 1048576 -> 1024 * 1024
- scope variables.
- use ISO date in a comment.
- drop redundant parentheses.
- drop empty comments.
- unfold lines.
- duplicate/stray spaces in comments.
- fix indent, whitespace, minor typos.

Closes #20690

2 months agoclang-tidy: enable `bugprone-signed-char-misuse`, fix fallouts
Viktor Szakats [Wed, 18 Feb 2026 16:39:23 +0000 (17:39 +0100)] 
clang-tidy: enable `bugprone-signed-char-misuse`, fix fallouts

Examples:
```
lib/vtls/openssl.c:2585:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2585 |       msg_type = *(const char *)buf;
lib/vtls/openssl.c:2593:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2593 |       msg_type = *(const char *)buf;
tests/server/mqttd.c:514:10: warning: comparison between 'signed char' and 'unsigned char' [bugprone-signed-char-misuse]
  514 |       if(passwd_flag == (char)(conn_flags & passwd_flag)) {
tests/server/tftpd.c:362:13: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  362 |         c = test->rptr[0];
tests/server/tftpd.c:454:9: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  454 |     c = *p++;                     /* pick up a character */
src/tool_urlglob.c:272:46: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  272 |     pat->c.ascii.letter = pat->c.ascii.min = min_c;
src/tool_urlglob.c:273:24: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  273 |     pat->c.ascii.max = max_c;
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/first.c:86:15: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
   86 |     coptopt = arg[optpos];
```

Also:
- tests/server/mqttd: drop a redundant and a wrongly signed cast.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/signed-char-misuse.html

Closes #20654

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 25 Feb 2026 13:13:54 +0000 (14:13 +0100)] 
RELEASE-NOTES: synced

2 months agobuild: map Apple clang 26.4+ to llvm/clang 21.1
Viktor Szakats [Wed, 25 Feb 2026 01:10:29 +0000 (02:10 +0100)] 
build: map Apple clang 26.4+ to llvm/clang 21.1

Ref: https://en.wikipedia.org/wiki/Xcode#Xcode_26.0_(since_version_number_change)_2

Closes #20717

2 months agobuild: enable `-Wjump-misses-init` for clang 21+
Viktor Szakats [Wed, 25 Feb 2026 01:08:09 +0000 (02:08 +0100)] 
build: enable `-Wjump-misses-init` for clang 21+

Refs:
https://github.com/llvm/llvm-project/commit/543f112e148a81de290d099f10784dc3ff698aa4
https://github.com/llvm/llvm-project/commit/43c05d97389d479f78ca18b5d7957f51cb4022fd

Follow-up to db4d617c1cfbe74e010183a3595642434f55ea00 #16252

Closes #20716

2 months agodocs: add reproducible example for generating man page
Hamza Bensliman [Tue, 24 Feb 2026 07:09:07 +0000 (07:09 +0000)] 
docs: add reproducible example for generating man page

Fixes #20699
Reported-by: sammydono on github
Closes #20703

2 months agobuild: fix building rare combinations
Viktor Szakats [Tue, 24 Feb 2026 12:42:13 +0000 (13:42 +0100)] 
build: fix building rare combinations

- http/2 + !headers
- gnutls + !verbose
- ssls-export + !verbose

Closes #20712

2 months agotidy-up: macro parentheses
Viktor Szakats [Sun, 15 Feb 2026 19:34:09 +0000 (20:34 +0100)] 
tidy-up: macro parentheses

Add missing and drop redundant parentheses.

Also: fix whitespace.

Ref: #20690

Closes #20710

2 months agomanagen: silence Perl warnings
Viktor Szakats [Tue, 24 Feb 2026 11:07:45 +0000 (12:07 +0100)] 
managen: silence Perl warnings

Closes #20707

2 months agoDEPRECATE.md: TLS SRP support gets removed in August 2026
Daniel Stenberg [Mon, 23 Feb 2026 22:55:59 +0000 (23:55 +0100)] 
DEPRECATE.md: TLS SRP support gets removed in August 2026

Closes #20697

2 months agoconfig-riscos.h: drop all undefs
Daniel Stenberg [Tue, 24 Feb 2026 13:59:01 +0000 (14:59 +0100)] 
config-riscos.h: drop all undefs

They are superfluous

Closes #20711

2 months agotop-complexity: lower the max allowed complexity to 60
Daniel Stenberg [Tue, 24 Feb 2026 10:21:20 +0000 (11:21 +0100)] 
top-complexity: lower the max allowed complexity to 60

Closes #20706

2 months agoopenssl: fix potential NULL dereference when loading certs (Windows)
Viktor Szakats [Thu, 19 Feb 2026 17:10:58 +0000 (18:10 +0100)] 
openssl: fix potential NULL dereference when loading certs (Windows)

This could happen if the first cert to be loaded missed EKU (Enhanced
Key Usage) data, when using native CA on Windows.

Fix by skipping certs without Enhanced Key Usage data.

Detected by clang-tidy:
```
lib/vtls/openssl.c:2922:15: warning: Access to field 'cUsageIdentifier'
 results in a dereference of a null pointer (loaded from variable
 'enhkey_usage') [clang-analyzer-core.NullDereference]
 2922 |           if(!enhkey_usage->cUsageIdentifier) {
      |               ^
```

Refs:
https://learn.microsoft.com/windows/win32/secgloss/e-gly
https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetenhancedkeyusage
https://gitlab.winehq.org/wine/wine/-/blob/wine-11.2/dlls/crypt32/cert.c?ref_type=tags#L3061-3164

Assisted-by: Stefan Eissing
Closes #20634

2 months agombedtls: split mbed_connect_step1 into sub functions
Daniel Stenberg [Mon, 23 Feb 2026 13:45:44 +0000 (14:45 +0100)] 
mbedtls: split mbed_connect_step1 into sub functions

Increase readability. Reduce complexity.

Closes #20689

2 months agosetopt: refuse blobs with zero length
Daniel Stenberg [Tue, 24 Feb 2026 10:01:35 +0000 (11:01 +0100)] 
setopt: refuse blobs with zero length

A blob must have a length or it will not be accepted. By enforcing the
check here, TLS backend code can rely on the fact that the length is
always non-zero from this point.

Reported-by: aisle-research-bot
URL: https://github.com/curl/curl/pull/20689#pullrequestreview-3846390367
Closes #20705

2 months agodocs: use dot instead of comma at end of sentences
Diogo Correia [Tue, 24 Feb 2026 00:58:35 +0000 (01:58 +0100)] 
docs: use dot instead of comma at end of sentences

Some sentences incorrectly ended with a command instead of a dot.

Closes #20700

2 months agoINSTALL-CMAKE.md: document the `curl` build target
Viktor Szakats [Mon, 23 Feb 2026 19:23:58 +0000 (20:23 +0100)] 
INSTALL-CMAKE.md: document the `curl` build target

Can be useful to together with `testdeps` to build all binaries.

Closes #20694

2 months agospacecheck: double spaces in folded strings, fix fallouts
Viktor Szakats [Mon, 23 Feb 2026 21:12:03 +0000 (22:12 +0100)] 
spacecheck: double spaces in folded strings, fix fallouts

Closes #20695

2 months agoclang-tidy: enable `readability-math-missing-parentheses`, adjust code
Viktor Szakats [Sun, 22 Feb 2026 23:59:57 +0000 (00:59 +0100)] 
clang-tidy: enable `readability-math-missing-parentheses`, adjust code

No functional changes.

Also:
- md4, md5: drop redundant parentheses from macro values.

Closes #20691

2 months agoftp: split ftp_state_use_port into sub functions
Daniel Stenberg [Sun, 22 Feb 2026 15:55:55 +0000 (16:55 +0100)] 
ftp: split ftp_state_use_port into sub functions

For readability and reduced complexity.

Fixed a bug when FTPPORT specifies an IPv6-address only, without brackets.

Closes #20685

2 months agoclang-tidy: add arg names to prototypes where missing (cont.)
Viktor Szakats [Mon, 23 Feb 2026 14:52:39 +0000 (15:52 +0100)] 
clang-tidy: add arg names to prototypes where missing (cont.)

Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`. Seen on Windows.

Follow-up to e8415ad3c7ab69a7056daa4b39e7a0044c43f5ba #20657
Follow-up to c878160e9c1f7366e64299aa02540d5495c3df9c #20624

Closes #20693

2 months agosetopt: make setopt_copypostfields a separate function
Daniel Stenberg [Mon, 23 Feb 2026 12:47:18 +0000 (13:47 +0100)] 
setopt: make setopt_copypostfields a separate function

Closes #20688

2 months agolib: use lib source directory as base include path
Viktor Szakats [Wed, 18 Feb 2026 23:44:43 +0000 (00:44 +0100)] 
lib: use lib source directory as base include path

Backtrack on previous change that aimed to solve the wrong `share.h`
being included. It turns out it did not fix this issue. At the same time
it introduced relative header filenames and the need to include the same
headers differently depending on the source files' location, reducing
readability and editability.

Replace this method by re-adding curl's lib source directory to the
header path and addressing headers by the their full, relative name to
that base directory. Aligning with this method already used in src and
tests.

With these advantages:
- makes includes easier to read, recognize, grep, sort, write, and copy
  between sources,
- syncs the way these headers are included across curl components,
- avoids the ambiguity between system `schannel.h`, `rustls.h` vs.
  local headers using the same names in `lib/vtls`,
- silences clang-tidy `readability-duplicate-include` checker, which
  detects the above issue,
  Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/duplicate-include.html
- possibly silences TIOBE coding standard warnings:
  `6.10.2.a: Don't use relative paths in #include statements.`
- long shot: it works well with concatenated test sources, for
  clang-tidy-friendly custom unity builds. Ref: #20667

Slight downside: it's not enforced.

If there happens to be a collision between a local `lib/*.h` header and
a system one, the solution is to rename (possibly with its `.c`
counterpart) into the `curl_` namespace. This is also the method used by
curl in the past.

Also:
- curlx/inet_pton: reduce scope of an include.
- toolx/tool_time: apply this to an include, and update VS project
  files accordingly. Also dropping unnecessary lib/curlx header path.
- clang-tidy: enable `readability-duplicate-include`.

Follow-up to 3887069c661b40e76b053a4867eb565d4761ab3e #19676
Follow-up to 625f2c1644da58b9617479775badea21f125ce6d #16991 #16949

Closes #20623

2 months agocmake: add C++ integration test
Viktor Szakats [Mon, 23 Feb 2026 12:32:52 +0000 (13:32 +0100)] 
cmake: add C++ integration test

Also:
- include code to verify a C++-specific public header regression
  reported in 8.19.0-rc2.
- curl/curl.h: mention C++ global namespace in comment.
- GHA/dist: add CI job for C++. Runtime: 15 seconds.

Follow-up to ee9b000438bd6e4cecc8a933804397a55ad0f7b8 #20686
Ref: #20682

Closes #20687

2 months agocurl/curl.h: revert to recursive macros to keep supporting C++ use-case
Viktor Szakats [Mon, 23 Feb 2026 11:00:18 +0000 (12:00 +0100)] 
curl/curl.h: revert to recursive macros to keep supporting C++ use-case

To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
  119 |     ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
      |                        ^
```

Also expand comment to highlight the case.

Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/commit/daa6b27b4d998d62c8198b4fe167199cc7bf0064#r177869049
Reported-by: Marcel Raad
Bug: https://curl.se/mail/lib-2026-02/0020.html
Fixes #20682
Follow-up to daa6b27b4d998d62c8198b4fe167199cc7bf0064 #20597

Closes #20686

2 months agocmake: always build curlu and curltool test libs in unity mode
Viktor Szakats [Sun, 22 Feb 2026 18:23:41 +0000 (19:23 +0100)] 
cmake: always build curlu and curltool test libs in unity mode

To speed up building/running tests by default (e.g. via `testdeps` or
`tests` targets.)

It reduces build commands to 21 (from 239) for a test build.

In CI, it affects build test step times as below:
- GHA/linux: aws-lc
  12s https://github.com/curl/curl/actions/runs/22279958343/job/64448913413 ->
  6s https://github.com/curl/curl/actions/runs/22282767915/job/64455970302
- GHA/linux: Fil-C
  39s https://github.com/curl/curl/actions/runs/22279958343/job/64448913430 ->
  37s https://github.com/curl/curl/actions/runs/22282767915/job/64455970352
- GHA/non-native: FreeBSD Intel
  22s https://github.com/curl/curl/actions/runs/22279958335/job/64448913514 ->
  15s https://github.com/curl/curl/actions/runs/22282767899/job/64455969960
- GHA/windows: dl-mingw 6.4.0
  23s https://github.com/curl/curl/actions/runs/22279958334/job/64448917225 ->
  9s https://github.com/curl/curl/actions/runs/22282767922/job/64455975006

Follow-up to fff9905bcf7c8c1da1668213d79473865461048f #20670

Closes #20677

2 months agoopenssl: fix compiler warning with OpenSSL master
Daniel Stenberg [Mon, 23 Feb 2026 08:11:18 +0000 (09:11 +0100)] 
openssl: fix compiler warning with OpenSSL master

vtls/openssl.c:469:15: error: assignment discards â€˜const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

X509_get_X509_PUBKEY() now returns a const pointer - but only on OpenSSL
3, we must keep the non-const version for all forks.

Closes #20681

2 months agoclang-tidy: add arg names to prototypes where missing
Viktor Szakats [Fri, 20 Feb 2026 23:01:22 +0000 (00:01 +0100)] 
clang-tidy: add arg names to prototypes where missing

Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`.

Follow-up to c878160e9c1f7366e64299aa02540d5495c3df9c #20624

Closes #20657

2 months agoURL-SYNTAX.md: fix port number mistakes for IMAP and LDAP
Daniel Stenberg [Sun, 22 Feb 2026 22:53:35 +0000 (23:53 +0100)] 
URL-SYNTAX.md: fix port number mistakes for IMAP and LDAP

Reported-by: Augment code
URL: https://github.com/curl/curl/pull/20673#pullrequestreview-3838139961
Closes #20679

2 months agotests/server: silence clang-tidy warning
Viktor Szakats [Sun, 22 Feb 2026 01:18:49 +0000 (02:18 +0100)] 
tests/server: silence clang-tidy warning

It looks like a case that can never happen in practice.

Seen on mingw-w64 with experimental concatenated (vs. #included) test
sources:
```
tests/server/util.c:662:16: error: Null pointer passed as 1st
 argument to string length function [clang-analyzer-unix.cstring.NullArg]
  662 |   size_t len = strlen(unix_socket);
      |                ^
```
Ref: https://github.com/curl/curl/actions/runs/22267482855/job/64416261156#step:10:273

Closes #20668

2 months agoGHA/non-native: enable FreeBSD on arm again
Viktor Szakats [Sun, 22 Feb 2026 19:27:14 +0000 (20:27 +0100)] 
GHA/non-native: enable FreeBSD on arm again

Upstream package install is working again.

Follow-up to 41a6eeadf6de719caf414c3520e912db989a6d43 #20267

Closes #20678

2 months agocmake: force-disable unity for clang-tidied build targets only
Viktor Szakats [Sun, 22 Feb 2026 10:41:49 +0000 (11:41 +0100)] 
cmake: force-disable unity for clang-tidied build targets only

Instead of globally disabling unity for all targets when clang-tidy is
enabled.

After this patch `CMAKE_UNITY_BUILD=ON` is honored for:
- static libcurl when building both static and shared separately.
- libcurlu and libcurltool internal libraries when building the test
  target.

While keeping unity disabled for the libcurl build pass running
clang-tidy, and the curl tool, also running clang-tidy.

To make clang-tidy-enabled builds finish faster when unity mode is
enabled, yet performs the same clang-tidy checks as before this patch.

Effect on:
- GHA/macos: core build: same, buils tests 5-12 seconds faster,
  with steps going down from 259 to 25.

  52s: https://github.com/curl/curl/actions/runs/22279958340/job/64448913325 ->
  47s: https://github.com/curl/curl/actions/runs/22279873606/job/64448710743

- GHA/windows (not enabled): it'd save about 1 minute, bringing total
  time barely below 10m, still one of the slowest jobs overall.
  (#20667 is trying a way for 4x speed-up (with a drawback)).

  5m21s: https://github.com/curl/curl/actions/runs/22222907068/job/64284556852 ->
  4m26s: https://github.com/curl/curl/actions/runs/22281033369/job/64451601548

Closes #20670

2 months agoconfig2setopts: split into smaller functions
Daniel Stenberg [Sun, 22 Feb 2026 14:17:18 +0000 (15:17 +0100)] 
config2setopts: split into smaller functions

Reduces complexity from 63 to 45

Closes #20676

2 months agosocks_sspi: split Curl_SOCKS5_gssapi_negotiate into sub functions
Daniel Stenberg [Sun, 22 Feb 2026 11:45:39 +0000 (12:45 +0100)] 
socks_sspi: split Curl_SOCKS5_gssapi_negotiate into sub functions

Create and use socks5_sspi_setup(), socks5_sspi_loop() and
socks5_sspi_encryption(). Reduces complexity.

Closes #20581

2 months agocmake: limit clang-tidy to the shared libcurl if static is also built
Viktor Szakats [Sun, 22 Feb 2026 13:13:21 +0000 (14:13 +0100)] 
cmake: limit clang-tidy to the shared libcurl if static is also built

On platforms that require building static and shared libcurl separately,
after this change clang-tidy is only run on one of them, to reduce build
time by avoiding the double-work. From a clang-tidy standpoint, static
and shared libs are identical.

Except `dllmain.c` on Windows, which is only present in shared. To keep
running it through clang-tidy, prefer the shared library for clang-tidy.

Closes #20675

2 months agotool: improve config error messaging
Daniel Stenberg [Sat, 21 Feb 2026 22:16:39 +0000 (23:16 +0100)] 
tool: improve config error messaging

- make sure that errors for specific options in config files identify
  the file, line number and shows the error about the correct option

- improve some error message wording

- add warning for leading single quote of arguments in config files
  (verified in test 1712)

- adjust test error outputs accordingly

test1712 introduces mode=warn

Use the mode="warn" attribute if the output curl warning output, as it
then makes the check without newlines and the prefix to better handle
that the lines may wrap at different points depending on the lengths of
the lines and terminal width.

Fixes #20598
Closes #20666

2 months agocmake: omit `curl.rc` from curltool lib
Viktor Szakats [Sun, 22 Feb 2026 10:20:30 +0000 (11:20 +0100)] 
cmake: omit `curl.rc` from curltool lib

It's unnecessary for static libs, and saves one build step when building
tests on Windows.

Closes #20671

2 months agoclang-tidy: add missing parentheses to debug macro arguments
Viktor Szakats [Sun, 22 Feb 2026 12:10:32 +0000 (13:10 +0100)] 
clang-tidy: add missing parentheses to debug macro arguments

Follow-up to 139307865a32a1a229e7517946e979e19e2f42c0 #20647

Closes #20674

2 months agobuild: adjust minimum version for some clang picky warnings
Viktor Szakats [Sat, 21 Feb 2026 22:48:18 +0000 (23:48 +0100)] 
build: adjust minimum version for some clang picky warnings

Enable 3 warnings earlier with autotools, update comments for the rest.

Ref: https://godbolt.org/

Closes #20665

2 months agoclang-tidy: check `bugprone-macro-parentheses`, fix fallouts
Viktor Szakats [Fri, 20 Feb 2026 13:20:53 +0000 (14:20 +0100)] 
clang-tidy: check `bugprone-macro-parentheses`, fix fallouts

Also:
- lib/parsedate: avoid relying on side-effect of missing parentheses.
- lib/http: drop redundant parentheses.
- fix cases in headers missed by clang-tidy.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html

Closes #20647

2 months agosilent.md: also mention it shuts off warning messages
Daniel Stenberg [Sat, 21 Feb 2026 22:34:05 +0000 (23:34 +0100)] 
silent.md: also mention it shuts off warning messages

Closes #20664

2 months agourl: fix copy and paste url_match_auth_nego mistake
Daniel Stenberg [Sat, 21 Feb 2026 17:11:41 +0000 (18:11 +0100)] 
url: fix copy and paste url_match_auth_nego mistake

Follow-up to 34fa034
Reported-by: dahmono on github
Closes #20662

2 months agoinet_pton: scope an include
Viktor Szakats [Thu, 19 Feb 2026 00:00:20 +0000 (01:00 +0100)] 
inet_pton: scope an include

Closes #20661

2 months agoopenssl: fix potential OOB read in debug/verbose logging
Viktor Szakats [Fri, 20 Feb 2026 20:41:40 +0000 (21:41 +0100)] 
openssl: fix potential OOB read in debug/verbose logging

Reported-by: aisle-research-bot
Bug: https://github.com/curl/curl/pull/20654#discussion_r2834860711

Closes #20656

2 months agoclang-tidy: drop some redundant conditions reported by `misc-redundant-expression`
Viktor Szakats [Wed, 18 Feb 2026 14:14:06 +0000 (15:14 +0100)] 
clang-tidy: drop some redundant conditions reported by `misc-redundant-expression`

Not enforced due to false positives, and because in cases a redundant
expression (e.g. encapsulated in a macro) may be preferred.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/redundant-expression.html

Closes #20644

2 months agoeasy: reset pausing when resetting request
Stefan Eissing [Fri, 20 Feb 2026 12:09:04 +0000 (13:09 +0100)] 
easy: reset pausing when resetting request

When the easy handle's request is reset, this needs to also reset
any pausing/ratelimit state.

Reported-by: Natris on github
Fixes #20641
Closes #20643

2 months agorequest.h: rename parameter 'buf' to 'req' in Curl_req_send
Christian Schmitz [Sat, 21 Feb 2026 11:57:35 +0000 (12:57 +0100)] 
request.h: rename parameter 'buf' to 'req' in Curl_req_send

Someone renamed the parameter, so we need to rename the documentation.

Closes #20660

2 months agoclang-tidy: link to main documentation page [ci skip]
Viktor Szakats [Fri, 20 Feb 2026 23:08:59 +0000 (00:08 +0100)] 
clang-tidy: link to main documentation page [ci skip]

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 20 Feb 2026 22:06:43 +0000 (23:06 +0100)] 
RELEASE-NOTES: synced

2 months agounit1654: fix clang-tidy `bugprone-redundant-branch-condition`
Viktor Szakats [Wed, 18 Feb 2026 16:43:14 +0000 (17:43 +0100)] 
unit1654: fix clang-tidy `bugprone-redundant-branch-condition`

```
tests/unit/unit1654.c:41:5: warning: redundant condition 'result' [bugprone-redundant-branch-condition]
   41 |     fail_if(result, "Curl_altsvc_load");
      |     ^
tests/libtest/unitcheck.h:29:5: note: expanded from macro 'fail_if'
   29 |     if(expr) {                                                         \
      |     ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/redundant-branch-condition.html

Closes #20648

2 months agoclang-tidy: check `misc-header-include-cycle`, fix in internal headers
Viktor Szakats [Wed, 18 Feb 2026 14:14:06 +0000 (15:14 +0100)] 
clang-tidy: check `misc-header-include-cycle`, fix in internal headers

Also opt-out `curl/curl.h` because it includes `curl/mprintf.h`, which
in turn includes `curl/curl.h` for `CURL_EXTERN`. Not changeable in
public headers to remain compatible. (Somehow only triggered for
examples.)

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/header-include-cycle.html

Closes #20645

2 months agolibtests: drop two redundant `memset()`s
Viktor Szakats [Wed, 18 Feb 2026 16:46:36 +0000 (17:46 +0100)] 
libtests: drop two redundant `memset()`s

Reported by clang-tidy `bugprone-sizeof-expression`.

Silencing:
```
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-expression.html

Closes #20649