Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The merged conditions preserve evaluation order and short-circuit behavior across the reviewed changes.
Pull request overview
Merges redundant nested if statements throughout curl while leaving clang-tidy enforcement disabled for remaining exceptions.
Changes:
- Combines nested conditions without changing short-circuit behavior.
- Updates tests and examples consistently.
- Documents the disabled clang-tidy check.
File summaries
| File | Description |
|---|---|
tests/unit/unit2603.c |
Simplifies parser assertion. |
tests/unit/unit1675.c |
Simplifies IPv6 zone validation. |
tests/unit/unit1627.c |
Simplifies scheme validation. |
tests/server/socksd.c |
Simplifies tunnel completion handling. |
tests/libtest/lib758.c |
Combines timeout conditions. |
tests/libtest/lib556.c |
Combines output-write conditions. |
tests/libtest/lib530.c |
Combines timeout conditions. |
tests/libtest/lib3102.c |
Simplifies certificate checks. |
tests/libtest/lib1560.c |
Simplifies URL-part validation. |
tests/libtest/cli_h2_pausing.c |
Simplifies pause-state validation. |
src/var.c |
Simplifies variable transformations and parsing. |
src/tool_writeout.c |
Simplifies write-out conditions. |
src/tool_urlglob.c |
Simplifies glob element handling. |
src/tool_getparam.c |
Simplifies option validation. |
src/tool_formparse.c |
Simplifies seek and escape handling. |
src/tool_cb_wrt.c |
Simplifies header writing. |
src/tool_cb_dbg.c |
Combines trace-output conditions. |
src/config2setopts.c |
Simplifies TLS-version adjustment. |
lib/vtls/openssl.c |
Simplifies PKCS#11 setup checks. |
lib/urlapi.c |
Simplifies IDN conversion condition. |
lib/url.c |
Simplifies connection matching and credential checks. |
lib/telnet.c |
Combines timeout checks. |
lib/smtp.c |
Simplifies address, MIME, and disconnect logic. |
lib/select.c |
Simplifies poll descriptor handling. |
lib/rtsp.c |
Simplifies range and transport parsing. |
lib/pop3.c |
Simplifies authentication and disconnect logic. |
lib/multi.c |
Simplifies Winsock event selection. |
lib/mime.c |
Simplifies MIME header decisions. |
lib/imap.c |
Simplifies MIME, flags, listing, and disconnect logic. |
lib/http.c |
Simplifies authentication, headers, and time conditions. |
lib/http_aws_sigv4.c |
Simplifies SigV4 buffer handling. |
lib/ftp.c |
Simplifies missing-file handling. |
lib/formdata.c |
Simplifies form validation and MIME setup. |
lib/easy.c |
Simplifies pause event updates. |
lib/curlx/inet_pton.c |
Simplifies leading IPv6 colon validation. |
lib/curl_share.c |
Simplifies share callbacks. |
lib/cshutdn.c |
Simplifies shutdown event handling. |
lib/connect.c |
Simplifies ALPN matching. |
lib/cf-socket.c |
Simplifies interface binding. |
lib/cf-ip-happy.c |
Simplifies reply-time selection. |
lib/cf-https-connect.c |
Simplifies Happy Eyeballs timing. |
lib/cf-h2-proxy.c |
Simplifies final-response detection. |
docs/examples/websocket.c |
Simplifies PONG comparison. |
docs/examples/multi-double.c |
Simplifies completion handling. |
.clang-tidy.yml |
Documents the unenforced check. |
Review details
- Files reviewed: 45/45 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bagder
approved these changes
Sep 2, 2026
Contributor
|
A great way to make backports more annoying? |
vszakats
marked this pull request as ready for review
September 2, 2026 08:09
This reverts commit bcf36e36170df13bebdf2ad899988706004313e1. https://github.com/llvm/llvm-project/blob/main/clang/docs/LifetimeSafety.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reported by clang-tidy 23.1.0+ via
readability-redundant-nested-if.Do not enforce at this time, due to a handful of places where it 1)
applies conditionally for non-debug builds (cf-h2-proxy.c), 2)
decreases readability (cookie.c, probably could be fixed by using temp
variables or code refactor), 3) breaks code structure (protocol.c).
Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-nested-if.html
https://github.com/curl/curl/pull/22793/files?w=1