]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdio: Fix clang warnings on tests
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 27 Jul 2023 18:27:08 +0000 (15:27 -0300)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 22 Dec 2024 09:43:11 +0000 (17:43 +0800)
clang does not support 'I' specifier and handles it as a 'length
modifier'.
Reviewed-by: Sam James <sam@gentoo.org>
stdio-common/tst-scanf-to_inpunct.c

index 6fc038f476ffefb1a26548610a2d9fbb5c763c64..fab1a232b976e5fc35f76e2780d0b1f57f6453f3 100644 (file)
@@ -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);
     }