public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Joseph Myers <jsm28@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] Disable -Wstringop-overread for some string tests Date: Mon, 7 Sep 2020 18:11:27 +0000 (GMT) [thread overview] Message-ID: <20200907181127.A6D89393C85F@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e74b61c09a2a2ab52153e731225ccba5078659b1 commit e74b61c09a2a2ab52153e731225ccba5078659b1 Author: Joseph Myers <joseph@codesourcery.com> Date: Mon Sep 7 18:11:12 2020 +0000 Disable -Wstringop-overread for some string tests Similarly to Maciej's changes to fix the build of rawmemchr in the presence of GCC 11's -Wstringop-overread, also disable that option in two string function tests that have similar warnings and other string function warnings already disabled. Tested with build-many-glibcs.py for aarch64-linux-gnu and arm-linux-gnueabi that it fixes building the glibc testsuite. Diff: --- string/tester.c | 3 +++ string/tst-cmp.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/string/tester.c b/string/tester.c index bcd7148c2e..b7acf29c81 100644 --- a/string/tester.c +++ b/string/tester.c @@ -47,6 +47,9 @@ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow="); #if __GNUC_PREREQ (8, 0) DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation"); #endif +#if __GNUC_PREREQ (11, 0) +DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); +#endif #define STREQ(a, b) (strcmp((a), (b)) == 0) diff --git a/string/tst-cmp.c b/string/tst-cmp.c index 13af0fcb83..e73025cfdf 100644 --- a/string/tst-cmp.c +++ b/string/tst-cmp.c @@ -104,6 +104,10 @@ strncmp_max (const char *left, const char *right) /* GCC 9 warns about the size passed to strncmp being larger than PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow="); +#endif +#if __GNUC_PREREQ (11, 0) + /* Likewise GCC 11, with a different warning option. */ + DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); #endif return strncmp (left, right, SIZE_MAX); DIAG_POP_NEEDS_COMMENT; @@ -117,6 +121,10 @@ strncasecmp_max (const char *left, const char *right) /* GCC 9 warns about the size passed to strncasecmp being larger than PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow="); +#endif +#if __GNUC_PREREQ (11, 0) + /* Likewise GCC 11, with a different warning option. */ + DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); #endif return strncasecmp (left, right, SIZE_MAX); DIAG_POP_NEEDS_COMMENT;
reply other threads:[~2020-09-07 18:11 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200907181127.A6D89393C85F@sourceware.org \ --to=jsm28@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).