libc: swscanf is absent (PS5CEMU-HAR); fix branch ready #4464
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-12T12:28:38Z.
libc (libSceLibcInternal) lacks
swscanf(NIDHNnWdT43ues). PS5CEMU-HAR (PPSA99360) imports it at registry index 292, right afterpthread_setaffinity_np(276), so once #3787 and the setaffinity branch are in, the predicted stop isFAIL: unresolved ELF import HNnWdT43ues from libSceLibcInternal.prx; not yet observed in a run.Fix branch ready:
screamm:feat/libc-swscanf(569cb122, one commit onmainffa19840). I cannot open it as a PR under the intake rule while #4081 is open; anyone eligible is welcome to carry it, keeping the commit as is.swscanf(s, format, ...)with the 16-bit guestwchar_tshares one scanner with the existingswscanf_s(ScanningWide.cpp, from #3083): a flag decides whether a buffer-size argument is read after%s,%cand%[; without it the whole field is written, as FreeBSD 11.4swscanf.cpassing straight tovswscanfdoes.swscanf_sbehaviour is unchanged and its cases still pass; error messages now carry the calling function's name. The null checks returnEOF; everything that threw forswscanf_s(scanset ranges,%Ld,%nwith*or a width, unknown conversions, narrow%s/%c/%[input without a single-byte form) throws forswscanftoo. Theswscanf_sTechnicalDebt bullet is widened to cover both (no console confirmation; the engine follows C11 where FreeBSD's scanner differs on literal mismatches and prefix-only fields).guest_wide_conversiongains 40swscanfcases mirroring theswscanf_sones without size arguments: integers (%ihex prefix,*, widths,%ld,%hd, a bad%xprefix), floats (%lf,%Lf, infinity, incomplete exponent), strings (%lsnot cut off,%3ls,%s,%2lc,%ckeeping spaces,%l[,%l[^, narrow%[^=]),%ln,%nafter a suppressed conversion,%%, a partial match returning 1,EOFon empty and whitespace-only input, null buffer/format and the throws.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_wide_conversion3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"606/606; withmain'sScanningWide.cppthe extended test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by arcwiser on 2026-10-12T12:41:17Z.
Carried in #4467 with commit authorship preserved. I rebased it onto current main and independently validated it on Windows 11 build 26200 with the supported WinLibs GCC 15.2.0 r7 toolchain: the focused guest_wide_conversion test passes 3/3, conventions and diff checks pass, all 705 built test executables remain registered, and the project overlap checker reports no open overlap. Thank you for preparing and testing the implementation.