fix(libc): format FreeBSD-only printf conversions and reject the rest instead of aborting #4995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4995"
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 ErenYeager1836 on 2026-10-13T07:36:28Z.
Carries
husseinkad:fix/libc-format-freebsd-conversions. Fixes #3975.What
On the Windows formatting path, the printf family aborted on
%qd,%D,%O,%U, unknown conversions and a trailing%, where FreeBSD formats them.%qd/%q*are formatted as long long,%D/%O/%Uas their long forms,%jDand the other width/precision forms follow the known rules, an unknown conversion prints verbatim, and a trailing%prints nothing more. Conversions FreeBSD supports but Windows does not (%m, positional arguments, the'flag, too-long widths) keep throwing, now verified in the test suite.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Ninja, Release,
BUILD_TESTING=ON:guest_formattingpasses (the new FreeBSD-conversion cases and the throwing set).python tools/check_conventions.py --base upstream/mainandpython tools/check_test_registration.pypass.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 oneandonlydean on 2026-10-14T04:30:46Z.
This carries the same husseinkad branch for #3975 as #3987, so only one of them can go in, and the open review on #3987 applies here too: which title prints
%qd,%D/%O/%U, an unknown conversion or a trailing%? The console'slibc.prxformats through Dinkumware's_Printf, not FreeBSD'svfprintf.c, so the expected output needs to come from that code. Until then the throw stays. Closing in favour of #3987; please reopen if that one is dropped.Pull request closed