Repository navigation
Conversation
This was referenced Oct 14, 2026
|
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.
|
Collaborator
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
This was referenced Oct 14, 2026
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.
What
On Linux,
sscanf,vsscanf,sscanf_sandvsscanf_sthrew for the 16-bit wide conversions%ls,%lc,%l[,%Sand%C(#3984), because glibc would store a 32-bitwchar_tper character into the guest's 16-bit buffer. Windows already handed them to its host, whosewchar_tis 16 bits.When the format has such a conversion, these functions now go through the per-directive scanner the
_sforms already use (ScanGuest). Each wide directive is scanned as its narrow form into a temporary buffer, then each byte is widened to onechar16_t, as the C locale of FreeBSD 11'snone.cconverts a byte to the wide character of the same value.%lsand%l[are terminated,%lcis not, and in the_sforms the capacity counts 16-bit characters (a string that does not fit stores an empty string, as for%s). Formats without a wide conversion still go to the host unchanged.A wide conversion combined with a positional argument or the
'flag still throws, asScanGuesthandles neither.fscanfkeeps throwing for wide conversions: it reads from a host stream and needs separate handling. On Windows,sscanf,vsscanfandfscanfstill throw for%Sand%C, which their format translation does not accept; that is unchanged here. The technical debt entry is updated accordingly.guest_formattingreplaces the Linux rejection checks with checks on both platforms for%ls,%lcwith a width,%l[throughvsscanf, a byte above 0x7f, the_scapacity (fit, overflow,%lc), empty input and the remaining rejections, plus%Sand%Con Linux. It aborts onmainand passes with the change.Tested
Linux (Arch, GCC), Release,
BUILD_TESTING=ON, based onmaince5c83953:guest_formattingaborts onmainand passes with the change (3 runs); full build and fullctestpass. Windows (WinLibs MinGW-w64 GCC 15.2.0 r7, NVIDIA RTX 5060), Release,BUILD_TESTING=ON: full build and fullctestpass (1111 tests, the same 8 skipped as onmain;guest_formattingwas rerun after restricting the%S/%Ccases to Linux and passes, 3 runs). No title or homebrew run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)