tests: nest the client guard inside the SFTP one - #1273
Conversation
A client-only block in regress.c closed inside #ifdef WOLFSSH_SFTP, so TestSftpAttributesRoundTrip() built without SFTP and --enable-scp failed on an unused function. The client block now closes before the SFTP guard and reopens inside it.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1273
Scan targets checked: wolfssh-bugs
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR fixes a test build warning-as-error by ensuring client-only test helpers under tests/regress.c are only compiled when both the client and SFTP features are enabled.
Changes:
- Closes the
!NO_WOLFSSH_CLIENTguard before entering the SFTP-only test section. - Nests the client-only guard inside
#ifdef WOLFSSH_SFTPto prevent unused-function warnings when SFTP is disabled.
| File | Description |
|---|---|
| tests/regress.c | Reorders/nests preprocessor guards so SFTP client-only tests compile only when both SFTP and client support are enabled. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Confirmed this fixes issue. |

A client-only guard in
tests/regress.ccrossed the SFTP guard, soTestSftpAttributesRoundTrip()built without SFTP and--enable-scpfailed with-Werroron an unused function.#ifdef WOLFSSH_SFTP