[RFC v4 1/2] Add [v]aprintf(3)
Joseph Myers
josmyers@redhat.com
Fri Mar 20 16:53:20 GMT 2026
On Wed, 18 Mar 2026, Alejandro Colomar wrote:
> diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h
> index 193494db..b9fed67e 100644
> --- a/libio/bits/stdio2.h
> +++ b/libio/bits/stdio2.h
> @@ -200,6 +200,18 @@ vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)
>
> # ifdef __USE_GNU
> # ifdef __va_arg_pack
> +__fortify_function char *
> +__NTH (aprintf (const char *__restrict __fmt, ...))
> +{
> + return __aprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
> +}
> +
> +__fortify_function char *
> +__NTH (__aprintf (const char *__restrict __fmt, ...))
> +{
> + return __aprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
> +}
Why is an internal name __aprintf being defined or declared in installed
headers at all?
> diff --git a/stdio-common/Versions b/stdio-common/Versions
> index 8e1cbf85..aee611b2 100644
> --- a/stdio-common/Versions
> +++ b/stdio-common/Versions
> @@ -70,6 +70,8 @@ libc {
> __isoc23_vfscanf;
> __isoc23_sscanf;
> __isoc23_vsscanf;
> + GLIBC_2.44 {
> + aprintf;
> }
I don't see how this (inserting unbalanced '{' rather than a proper
GLIBC_2.44 section separate from other versions) could work; if it does,
it must be because of insufficient syntax checking somewhere in version
map processing.
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list