fix(libc): format %p as FreeBSD does on Windows #3393
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3393"
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 LeandroLP23 on 2026-10-11T09:40:54Z.
Carrying @husseinkad's fix for #3111 (they can't open PRs yet). The change is theirs:
37a1b95aandf5991134cherry-picked ontomainwithout conflicts, authorship kept.What
On Windows the printf family formats
%pwith the host's rules, a zero-padded 16-digit value without0x. It now follows FreeBSD (0xplus the hex digits, flags, width and precision as FreeBSD'svfprintfapplies them) in both the narrow and the wide formatters; Linux keeps glibc's%p, recorded in TechnicalDebt. Details, including the 2.8 million-call comparison against FreeBSD's algorithm, in #3111.Tested
Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, on
mainf8d8ae52:guest_formattingandguest_wide_formattingpass 3/3 and fail withmain's formatting code;ctest -E agc_445/445 apart from oneguest_ampr_markersrun that hit a guest arena overlap in the parallel run and passes 3/3 alone; conventions pass.Fork CI (run): Windows and the three relinker jobs pass. Linux fails
agc_driver_image_plane_address_on_line_implicit_lodandguest_kernel_stack_protect, the same two in all three runs of this batch (#3111, #3076 and #3097 fixes, unrelated changes), so they come frommain.Fixes #3111
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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:58:01Z.
Checked
FormatPointeragainst FreeBSDvfprintf.c(case 'p': unconditional0x,+/space/#ignored,0ignored with a precision, width counts the prefix,%.0pof NULL prints0x): matches. Built and ran libc/libs ctest on Linux (72/72);guest_wide_formattingfails without the change. The narrow Windows branch is covered by your Windows run only. Merging.