Re: [PATCH v4 next 00/23] Enhance printf()
From: Thomas Weißschuh
Date: Sat Mar 07 2026 - 13:02:47 EST
Hi David,
On 2026-03-02 10:17:52+0000, david.laight.linux@xxxxxxxxx wrote:
> From: David Laight <david.laight.linux@xxxxxxxxx>
(...)
I am happy with the patches of this series.
> David Laight (23):
> tools/nolibc: Add _NOLIBC_OPTIMIZER_HIDE_VAR() to compiler.h
> tools/nolibc/printf: Move snprintf length check to callback
> selftests/nolibc: Return correct value when printf test fails
> selftests/nolibc: check vsnprintf() output buffer before the length
> selftests/nolibc: Use length of 'expected' string to check snprintf() output
> selftests/nolibc: Check that snprintf() doesn't write beyond the buffer end
> selftests/nolibc: Let EXPECT_VFPRINTF() tests be skipped
> selftests/nolibc: Rename w to written in expect_vfprintf()
Unfortunately b4 chokes on these patches because this patch is missing
the 'v4' tag in the subject prefix. Given that the one below needs some
changes anyways, I was lazy and applied the series only up until here.
(Patch 1 is also not applied, as there was no user yet for
_NOLIBC_OPTIMIZER_HIDE_VAR() ).
Could you rebase the series on nolibc-next, add the error handling
to strerror_r(), fix the wording nitpicks from Willy and resend the
patches? I can also try to fix this up locally, but that would be more
work on my side than it would be for you I reckon.
Let me know if this is an issue and I'll try to make it work.
Willy:
I interpreted your mail [0] as Acked-by for the whole series.
[0] https://lore.kernel.org/lkml/aawDlqLdpgsfGI4r@xxxxxx/
> tools/nolibc: Implement strerror() in terms of strerror_r()
> tools/nolibc: Rename the 'errnum' parameter to strerror()
> tools/nolibc/printf: Output pad characters in 16 byte chunks
> tools/nolibc/printf: Simplify __nolibc_printf()
> tools/nolibc/printf: Use goto and reduce indentation
> tools/nolibc/printf: Use bit-masks to hold requested flag, length and conversion chars
> tools/nolibc/printf: Add support for length modifiers tzqL and formats iX
> tools/nolibc/printf: Handle "%s" with the numeric formats
> tools/nolibc/printf: Prepend sign to converted number
> tools/nolibc/printf: Add support for conversion flags space and plus
> tools/nolibc/printf: Special case 0 and add support for %#x
> tools/nolibc/printf: Add support for left aligning fields
> tools/nolibc/printf: Add support for zero padding and field precision
> tools/nolibc/printf: Add support for octal output
> selftests/nolibc: Use printf variable field widths and precisions
>
> tools/include/nolibc/compiler.h | 3 +
> tools/include/nolibc/stdio.h | 501 ++++++++++++++-----
> tools/testing/selftests/nolibc/nolibc-test.c | 157 +++---
> 3 files changed, 469 insertions(+), 192 deletions(-)