From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 61142385084C; Fri, 3 Jun 2022 14:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61142385084C 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: Fix tst-printf-width-i18n for clang X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: ada82e1aabc8d945cf49e56456aafbe3d129ce75 X-Git-Newrev: 2f3bf69833928cfd4a933359a7661e6c202ea77d Message-Id: <20220603141257.61142385084C@sourceware.org> Date: Fri, 3 Jun 2022 14:12:57 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 14:12:57 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2f3bf69833928cfd4a933359a7661e6c202ea77d commit 2f3bf69833928cfd4a933359a7661e6c202ea77d Author: Adhemerval Zanella Date: Fri May 20 10:22:56 2022 -0300 stdio: Fix tst-printf-width-i18n for clang Diff: --- stdio-common/Makefile | 1 + stdio-common/tst-printf-width-i18n.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/stdio-common/Makefile b/stdio-common/Makefile index ed75d09764..1bb0a381f1 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -97,6 +97,7 @@ aux := \ # aux tests := \ + tst-printf-width-i18n \ bug-vfprintf-nargs \ bug1 \ bug10 \ diff --git a/stdio-common/tst-printf-width-i18n.c b/stdio-common/tst-printf-width-i18n.c index 2355f30d67..2d3e742df1 100644 --- a/stdio-common/tst-printf-width-i18n.c +++ b/stdio-common/tst-printf-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,9 @@ do_test (void) TEST_COMPARE_STRING (buf, " 12٬346 AFN"); /* Counts bytes. */ /* 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, "%I11d", 12345), 11); TEST_COMPARE_STRING (buf, " ١٢٣۴٥"); TEST_COMPARE (sprintf (buf, "%I12.2f", 12345.67), 20); @@ -88,6 +96,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; }