From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 240073858296; Wed, 30 Aug 2023 12:39:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 240073858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693399153; bh=87tNwpkpEgYzo2J79zvOZYJm+HiC0wupxfOj4A065lw=; h=From:To:Subject:Date:From; b=oQTKDfTck8CpvYL8SoqHXNGqOAY8APOuYqwwf9A/SEKG4CItrKk5J21hoiNvk24sc C/ErP2y2GnoxKE3AeGe0jGO+R9Tu/1Kop9Q87KWjm7a1a79+wu59gGYt7Rvi/uo+t7 TgOJQ4vUFSctY4TtEVt9Oj9VvHWYsJQmW8Ks7mwg= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] stdio: Suppress clang warnings for tst-vprintf-width-i18n.c X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 004696fef4a29219b7b47e04b904bdb27407237a X-Git-Newrev: 948cce6cf63c2aa3182f3e6018724ac3c0229fe7 Message-Id: <20230830123913.240073858296@sourceware.org> Date: Wed, 30 Aug 2023 12:39:13 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=948cce6cf63c2aa3182f3e6018724ac3c0229fe7 commit 948cce6cf63c2aa3182f3e6018724ac3c0229fe7 Author: Adhemerval Zanella Date: Fri Jun 3 10:43:42 2022 -0300 stdio: Suppress clang warnings for tst-vprintf-width-i18n.c Clang issues the following warning: tst-vfprintf-width-i18n.c:51:34: error: invalid conversion specifier '1' [-Werror,-Wformat-invalid-specifier] TEST_COMPARE (sprintf (buf, "%I16d", 12345), 16); ~~^ Since it does not how to handle %I. Diff: --- stdio-common/tst-vfprintf-width-i18n.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stdio-common/tst-vfprintf-width-i18n.c b/stdio-common/tst-vfprintf-width-i18n.c index 6d5a5f8a59..b9c0a16c63 100644 --- a/stdio-common/tst-vfprintf-width-i18n.c +++ b/stdio-common/tst-vfprintf-width-i18n.c @@ -23,6 +23,7 @@ #include #include #include +#include static int do_test (void) @@ -48,6 +49,9 @@ do_test (void) TEST_COMPARE_STRING (buf, " INR12,345.67"); /* Translated. */ + /* clang does not know about the GNU extension 'I'. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (14, "-Wformat-invalid-specifier"); TEST_COMPARE (sprintf (buf, "%I16d", 12345), 16); TEST_COMPARE_STRING (buf, " १२३४५"); TEST_COMPARE (sprintf (buf, "%I12.2f", 12345.67), 26); @@ -58,6 +62,7 @@ do_test (void) TEST_COMPARE_STRING (buf, " १२,३४५"); TEST_COMPARE (sprintf (buf, "%'I12.2f", 12345.67), 26); TEST_COMPARE_STRING (buf, " १२,३४५.६७"); + DIAG_POP_NEEDS_COMMENT_CLANG; xsetlocale (LC_ALL, "ps_AF.UTF-8"); @@ -78,6 +83,8 @@ do_test (void) TEST_COMPARE_STRING (buf, " 12٬346 AFN"); /* Counts bytes. */ /* Translated. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (14, "-Wformat-invalid-specifier"); TEST_COMPARE (sprintf (buf, "%I11d", 12345), 11); TEST_COMPARE_STRING (buf, " ١٢٣۴٥"); TEST_COMPARE (sprintf (buf, "%I12.2f", 12345.67), 20); @@ -88,6 +95,7 @@ do_test (void) TEST_COMPARE_STRING (buf, " ١٢٬٣۴٥"); TEST_COMPARE (sprintf (buf, "%'I12.2f", 12345.67), 21); TEST_COMPARE_STRING (buf, " ١٢٬٣۴٥٫٦٧"); + DIAG_POP_NEEDS_COMMENT_CLANG; return 0; }