From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id B55693856DDC; Fri, 29 Apr 2022 14:06:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B55693856DDC Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] stdio: Disable clang warning on scanf13 test X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 558dd94d417dc6410d93bd4115adf0e9acccc5ab X-Git-Newrev: 1b5838882dce484fc998fae23f4f54c27d0e6e97 Message-Id: <20220429140622.B55693856DDC@sourceware.org> Date: Fri, 29 Apr 2022 14:06:22 +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, 29 Apr 2022 14:06:22 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1b5838882dce484fc998fae23f4f54c27d0e6e97 commit 1b5838882dce484fc998fae23f4f54c27d0e6e97 Author: Adhemerval Zanella Date: Thu Mar 24 15:46:34 2022 -0300 stdio: Disable clang warning on scanf13 test Diff: --- stdio-common/scanf13.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/stdio-common/scanf13.c b/stdio-common/scanf13.c index 720224aa05..02d258ae9f 100644 --- a/stdio-common/scanf13.c +++ b/stdio-common/scanf13.c @@ -3,6 +3,7 @@ #include #include #include +#include int main (void) @@ -20,6 +21,11 @@ main (void) } while (0) setlocale (LC_ALL, "de_DE.UTF-8"); + /* TODO: explain why clang need these. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); if (sscanf ("A \xc3\x84-\t\t\xc3\x84-abcdefbcd\t\xc3\x84-B", "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4) FAIL (); @@ -57,6 +63,7 @@ main (void) FAIL (); free (lsp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; memset (buf, '/', sizeof (buf)); buf[0] = '\t'; @@ -85,6 +92,9 @@ main (void) FAIL (); free (sp2); } + /* TODO: explain why clang need these. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wfortify-source"); if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2) FAIL (); else @@ -125,6 +135,7 @@ main (void) FAIL (); free (sp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; if (sscanf (buf, "%mS%mC", &lsp1, &lsp2) != 2) FAIL (); else @@ -141,6 +152,9 @@ main (void) FAIL (); free (lsp2); } + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-invalid-specifier"); + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wformat-extra-args"); if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) FAIL (); else @@ -181,6 +195,7 @@ main (void) FAIL (); free (lsp4); } + DIAG_POP_NEEDS_COMMENT_CLANG; return result; }