Skip to content

docs(debt): say that snwprintf_s does not invoke the exported constraint handler - #8941

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs/debt-snwprintf-s-handler
Oct 21, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
xXPBSXx:docs/debt-snwprintf-s-handler

Conversation

@xXPBSXx

@xXPBSXx xXPBSXx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What

The snwprintf_s entry of docs/dev/debt/libc.md said "set_constraint_handler_s is not exported". libc has exported it since 5290f92 (WideConversion.cpp:16), and snwprintf_s (FormattingWide.cpp:246-262) still never calls the installed handler: a violation only returns a negative value. The entry now says that the handler installed with set_constraint_handler_s is not invoked, which matches the snprintf_s and sscanf_s entries. No other open pull request changes this line (#7081, #8711 and #7841 touch other lines of the file).

Tested

Documentation only. Checked on the sources of current main: snwprintf_s has no call to the Sony constraint handler (SonyConstraintHandlerSlot is only used in WideConversion.cpp and FileAndHeap.cpp). The Markdown link scan reports 0 broken links and tools/check_conventions.py --base upstream/main passes. No code or test changed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes libc debt: snwprintf_s entry says set_constraint_handler_s is not exported #8940
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

…int handler

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the fix error Closes an issue (Fixes #N) label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8965 docs/dev/debt/libc.md L39-40

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3965 docs/dev/debt/libc.md
PR 5021 docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6469 docs/dev/debt/libc.md
PR 6879 docs/dev/debt/libc.md
PR 7081 docs/dev/debt/libc.md
PR 7447 docs/dev/debt/libc.md
PR 7648 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 8520 docs/dev/debt/libc.md

@MarcZX10 MarcZX10 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.

Reviewed against the implementation: FormattingWide.cpp does not invoke the installed Sony constraint handler in snwprintf_s, so this debt wording is accurate and removes the obsolete claim that set_constraint_handler_s is not exported. The overlap report for #7952 is unrelated to this line; it changes wcscpy_s and the Annex K list nearby. Applicable convention, intake, label, and report checks pass.

@github-actions github-actions Bot added the docs label Oct 21, 2026

@harisibrar1 harisibrar1 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.

Checked against main:

  • set_constraint_handler_s is exported (WideConversion.cpp:16-18, forwarding to SonySetConstraintHandlerS), so the old "is not exported" was stale.
  • snwprintf_s (FormattingWide.cpp:246-262) never reads SonyConstraintHandlerSlot(); a violation only yields -1 and buffer[0] = 0, so "the handler installed with set_constraint_handler_s is not invoked" is accurate and matches the sscanf_s entry (libc.md:59).
  • check_conventions.py --base main --head pr-8941 passes.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

@adriadam10 adriadam10 self-assigned this Oct 21, 2026
@adriadam10
adriadam10 merged commit 6b6c701 into boykopovar:main Oct 21, 2026
10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the snwprintf_s debt wording against FormattingWide.cpp: the installed constraint handler is never invoked, and set_constraint_handler_s is exported; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs fix error Closes an issue (Fixes #N)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libc debt: snwprintf_s entry says set_constraint_handler_s is not exported

4 participants