Skip to content

include: restore parentheses for macro arguments, for compatibility - #2577

Closed
vszakats wants to merge 12 commits into
libssh2:masterfrom
vszakats:macvalpar
Closed

vszakats wants to merge 12 commits into
libssh2:masterfrom
vszakats:macvalpar

Conversation

@vszakats

@vszakats vszakats commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

To avoid the chance of breaking compatibility. Make an exception for
values also passed to strlen() because these were already not
supporting callers passing x, y-style macro expressions to these
macros, as arguments.

Also note that SFTP handle args already did not support this due to the
lack of parentheses in libssh2_sftp_close(), libssh2_sftp_closedir()
macros.

Follow-up to b6f307d #1898

Copilot AI 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.

🟡 Changes recommended

The libssh2_channel_window_read compatibility restoration was omitted.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Restores compatibility-preserving parentheses around macro arguments, except arguments also passed to strlen().

Changes:

  • Restores argument parentheses across core, SFTP, and public-key convenience macros.
  • Retains intentional exceptions for string-length arguments.
File summaries
File Description
include/libssh2.h Updates core API macros.
include/libssh2_sftp.h Updates SFTP macros.
include/libssh2_publickey.h Updates public-key macros.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread include/libssh2.h Resolved

Copilot AI 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.

🟢 Approval recommended

The changes consistently restore compatibility without altering the documented exceptions.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@vszakats vszakats changed the title include: restore most parentheses for macro arguments include: restore most parentheses for macro arguments, for compatibility Sep 3, 2026
@vszakats vszakats changed the title include: restore most parentheses for macro arguments, for compatibility include: restore parentheses for macro arguments, for compatibility Sep 3, 2026
@vszakats vszakats closed this in dc656fd Sep 3, 2026
@vszakats
vszakats deleted the macvalpar branch September 3, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants