]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/nolibc/printf: Add support for length modifiers tzqL and formats iX
authorDavid Laight <david.laight.linux@gmail.com>
Sun, 8 Mar 2026 11:37:34 +0000 (11:37 +0000)
committerThomas Weißschuh <linux@weissschuh.net>
Fri, 20 Mar 2026 16:55:28 +0000 (17:55 +0100)
commit125632871929e9bf5b0bc907c8fef2d326e4623a
tree24fd554509943c5d478d766db7c91d2dbd8fcc7f
parent85f1152778f8cdc563ada12a3fc48c962b408d94
tools/nolibc/printf: Add support for length modifiers tzqL and formats iX

Length modifiers t (ptrdiff_t) and z (size_t) are aliases for l (long),
q and L are 64bit the same as j (intmax).
Format i is an alias for d and X similar to x but upper case.
Supporting them is mostly just adding the relevant bit to the bit
pattern used for matching characters.
Although %X is detected the output will be lower case.

Change/add tests to use conversions i and X, and length modifiers L and ll.
Use the correct minimum value for "%Li".

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260308113742.12649-10-david.laight.linux@gmail.com
[Thomas: Fix up testcases for musl libc]
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/stdio.h
tools/testing/selftests/nolibc/nolibc-test.c