From: Adhemerval Zanella Date: Thu, 27 Jul 2023 18:27:08 +0000 (-0300) Subject: stdio: Fix clang warnings on tests X-Git-Tag: glibc-2.41~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6cf084155870578835f6c8e6f1969c8b26d11ac;p=thirdparty%2Fglibc.git stdio: Fix clang warnings on tests clang does not support 'I' specifier and handles it as a 'length modifier'. Reviewed-by: Sam James --- 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 @@ . */ #include +#include #include #include #include @@ -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); }