]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdio: Fix test-printf-chk-ldbl-compat build with ubsan
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 24 Apr 2025 20:14:52 +0000 (17:14 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 8 May 2025 12:25:44 +0000 (09:25 -0300)
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);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sysdeps/ieee754/ldbl-128ibm-compat/test-printf-chk-ldbl-compat.c

index 6f6e42fecda6d514a2226ceff73505deeb7a857b..13f573ca73923c66cca524afd1098f822d2aee3d 100644 (file)
@@ -27,6 +27,7 @@
 #include <support/check.h>
 
 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)
 {