[COMMITTED] debug: Fix build with --enable-fortify-source=1 (BZ 33904)

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Feb 26 13:13:32 GMT 2026


The libio/bits/stdio2-decl.h only defined the prototypes for
__vasprintf_chk and __vfprintf_chk for __USE_FORTIFY_LEVEL > 1.
Also defined them for the internal header regardless.

Checked with a build with --enable-fortify-source=1 and
--enable-fortify-source=2 for all afftected ABIs.
---
 include/bits/stdio2-decl.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/bits/stdio2-decl.h b/include/bits/stdio2-decl.h
index 9758bf4b55..97c2236f24 100644
--- a/include/bits/stdio2-decl.h
+++ b/include/bits/stdio2-decl.h
@@ -3,6 +3,8 @@
 #ifndef _ISOMAC
 libc_hidden_proto (__fgets_unlocked_chk)
 libc_hidden_ldbl_proto (vfprintf)
+extern int __vasprintf_chk (char **, int, const char *, __gnuc_va_list) __THROW;
 libc_hidden_ldbl_proto (__vasprintf_chk)
+extern int __vfprintf_chk (FILE *, int, const char *, __gnuc_va_list);
 libc_hidden_ldbl_proto (__vfprintf_chk)
 #endif
-- 
2.43.0



More information about the Libc-alpha mailing list