feat(libc): scan 16-bit wide conversions in fscanf on Linux #5291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5291"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Nixitov on 2026-10-13T16:37:00Z.
What
Follows #5285, which taught
vsscanf/sscanfthe 16-bit wide conversions on Linux.fscanfstill threw for them; it now scans them the same way:%ls,%S,%lc,%Cdecode the stream's UTF-8 into the guest's 16-bit buffer independently of the host locale, a code point above U+FFFF becoming a surrogate pair;%l[is scanned through the host's wide scanset;%ncounts are read one character at a time, so the stream position and the reported counts match;vfscanfbehaviour.The
_sforms still throw for wide conversions on Linux.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.
guest_standard_streamsgains a wide case — a%ls %lsscan of a file written throughfprintf, followed by a%lcat end of file; it passes.guest_formattingandguest_wide_formattingpass;python tools/check_conventions.py --base origin/mainpasses.ScanFileWindows), so the new Linux stream scanner is exercised by Linux CI, not locally. The behaviour is recorded indocs/dev/debt/libc.md.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T16:37:43Z.
Progress report (
016db92→b4a53f6)📈 System libraries: 88.24% (+0.05%, +2 implemented functions)
✅ 2 implemented
fscanf_nid_postfixvsscanf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T17:00:38Z.
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.
main)core/libs/prx/libc/src/Formatting.cppL97-98, L293, L377, L396core/libs/prx/libc/src/Formatting.cppL11core/libs/prx/libc/src/Formatting.cppL11core/libs/prx/libc/src/Formatting.cppL98-99, L374, L393, L396docs/dev/debt/libc.mdL56Imported from boykopovar/AnyPS5. Originally posted by Nixitov on 2026-10-13T17:03:27Z.
Thanks bot. Same adjacent overlap as #5285, which this PR depends on: the wide-scanning scanner lives in
Formatting.cpp, which #4966 (suppressed conversions before EOF) and #5222 (EOF stickiness) also touch. The stream scanner added here (ScanWideFile) sits next toScanGuest.No duplicated logic; this builds on #5285. Whoever lands second needs a small rebase, and I'll align the wide scanners' input-failure/EOF return values with #5222's
ScanResultAtEndOfFilewhen it lands.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:29:33Z.
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.
Pull request closed