Skip to content

tests: nest the client guard inside the SFTP one - #1273

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:regress-sftp-guard
Sep 23, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
ejohnstown:regress-sftp-guard

Conversation

@ejohnstown

@ejohnstown ejohnstown commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

A client-only guard in tests/regress.c crossed the SFTP guard, so TestSftpAttributesRoundTrip() built without SFTP and --enable-scp failed with -Werror on an unused function.

  • nest the client guard inside #ifdef WOLFSSH_SFTP

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.
@ejohnstown
ejohnstown requested review from wolfSSL-Fenrir-bot and a lite review from Copilot September 23, 2026 04:17

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

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_CLIENT guard before entering the SFTP-only test section.
  • Nests the client-only guard inside #ifdef WOLFSSH_SFTP to 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.

Comment thread tests/regress.c
@philljj

philljj commented Sep 23, 2026

Copy link
Copy Markdown

Confirmed this fixes issue.

@philljj
philljj merged commit 712f181 into wolfSSL:master Sep 23, 2026
200 checks passed
@ejohnstown
ejohnstown deleted the regress-sftp-guard branch September 23, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants