From: Adhemerval Zanella Date: Thu, 24 Apr 2025 20:14:52 +0000 (-0300) Subject: stdio: Fix test-printf-chk-ldbl-compat build with ubsan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=319de1437933fccad6ef2cee57a749d31ad6ceb6;p=thirdparty%2Fglibc.git stdio: Fix test-printf-chk-ldbl-compat build with ubsan On powercp64le with --enable-ubsan the build fails with: ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c: In function ‘do_test_call_varg’: ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:60:3: error: null format string [-Werror=format-overflow=] 60 | __vfprintf_chk (stream, 1, format, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:66:3: error: null format string [-Werror=format-overflow=] 66 | __vprintf_chk (1, format, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:72:3: error: null format string [-Werror=format-truncation=] 72 | __vsnprintf_chk (string, 79, 1, 127, format, args); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c: In function ‘do_test_call_rarg.constprop’: ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:111:3: error: null format string [-Werror=format-overflow=] 111 | __fprintf_chk (stdout, 1, format, ld, d); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:115:3: error: null format string [-Werror=format-overflow=] 115 | __printf_chk (1, format, ld, d); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c:119:3: error: null format string [-Werror=format-truncation=] 119 | __snprintf_chk (string, 79, 1, 127, format, ld, d); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c index 6f6e42fecd..13f573ca73 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c @@ -27,6 +27,7 @@ #include static void +__attribute_disable_ubsan__ do_test_call_varg (FILE *stream, const char *format, ...) { char *buffer = NULL; @@ -83,6 +84,7 @@ do_test_call_varg (FILE *stream, const char *format, ...) } static void +__attribute_disable_ubsan__ do_test_call_rarg (FILE *stream, const char *format, long double ld, double d) {