From: Adhemerval Zanella Date: Fri, 17 Oct 2025 19:13:24 +0000 (-0300) Subject: stdio: Only use __va_arg_pack if compiler supports it X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=228ae5a35469001afb5e39d57fbf4b6293189214;p=thirdparty%2Fglibc.git stdio: Only use __va_arg_pack if compiler supports it Otherwise route __libc_message_wrapper to __libc_message_impl. Reviewed-by: Sam James --- diff --git a/include/stdio.h b/include/stdio.h index 17f5516c2b..181a746949 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -184,18 +184,21 @@ _Noreturn void __libc_message_impl (const char *__vmaname, const char *__fmt, #define __libc_fatal_vma_name "glibc: fatal" #define __libc_assert_vma_name "glibc: assert" +#ifdef __va_arg_pack static inline _Noreturn void __libc_message_wrapper (const char *vmaname, const char *fmt, ...) { -#ifdef __va_arg_pack_len if (__va_arg_pack_len () > LIBC_MESSAGE_MAX_ARGS) { __errordecl (__libc_message_error, "invalid number of arguments"); __libc_message_error (); } -#endif __libc_message_impl (vmaname, fmt, __va_arg_pack ()); } +#else +# define __libc_message_wrapper(__vmaname, __fmt, ...) \ + __libc_message_impl (__vmaname, __fmt, __VA_ARGS__) +#endif #define __libc_message(...) \ __libc_message_wrapper (__libc_fatal_vma_name, __VA_ARGS__) #define __libc_assert(...) \