about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-07-27 15:27:08 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-04-17 16:12:41 -0300
commitb3816426d9e35c6d15f901657b5beb1fdc3d51fa (patch)
tree5a4edaa1deb413620a3835f5fec20fe40c70150d
parent3be1ab1ff9a6e9e8115702c4dd6c8cb6e207a36d (diff)
downloadglibc-b3816426d9e35c6d15f901657b5beb1fdc3d51fa.tar.gz
glibc-b3816426d9e35c6d15f901657b5beb1fdc3d51fa.tar.xz
glibc-b3816426d9e35c6d15f901657b5beb1fdc3d51fa.zip
stdio: Fix clang warnings on tests
clang does not support 'I' specifier and handles it as a 'length
modifier'.
-rw-r--r--stdio-common/tst-scanf-to_inpunct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stdio-common/tst-scanf-to_inpunct.c b/stdio-common/tst-scanf-to_inpunct.c
index 6fc038f476..fab1a232b9 100644
--- a/stdio-common/tst-scanf-to_inpunct.c
+++ b/stdio-common/tst-scanf-to_inpunct.c
@@ -18,6 +18,7 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <array_length.h>
+#include <libc-diag.h>
 #include <stdio.h>
 #include <support/support.h>
 #include <support/check.h>
@@ -68,7 +69,11 @@ do_test (void)
   for (int i = 0; i < array_length (inputs); i++)
     {
       int n;
+      /* clang does not support 'I' specifier.  */
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat");
       sscanf (inputs[i].str, "%Id", &n);
+      DIAG_POP_NEEDS_COMMENT_CLANG;
       TEST_COMPARE (n, inputs[i].n);
     }