public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: fweimer@redhat.com (Florian Weimer)
To: libc-stable@sourceware.org
Subject: [2.26 COMMITTED] Disable strncat test array-bounds warnings for GCC 8.
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <20181022130216.DA7224399457D@oldenburg.str.redhat.com> (raw)

From: Joseph Myers <joseph@codesourcery.com>

Some strncat tests fail to build with GCC 8 because of -Warray-bounds
warnings.  These tests are deliberately test over-large size arguments
passed to strncat, and already disable -Wstringop-overflow warnings,
but now the warnings for these tests come under -Warray-bounds so that
option needs disabling for them as well, which this patch does (with
an update on the comments; the DIAG_IGNORE_NEEDS_COMMENT call for
-Warray-bounds doesn't need to be conditional itself, because that
option is supported by all versions of GCC that can build glibc).

Tested compilation with build-many-glibcs.py for aarch64-linux-gnu.

	* string/tester.c (test_strncat): Also disable -Warray-bounds
	warnings for two tests.

(cherry picked from commit 1421f39b7eadd3b5fbd2a3f2da1fc006b69fbc42)

2017-12-18  Joseph Myers  <joseph@codesourcery.com>

	* string/tester.c (test_strncat): Also disable -Warray-bounds
	warnings for two tests.

diff --git a/string/tester.c b/string/tester.c
index 66b11515b0..02ea8e1e16 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -387,9 +387,11 @@ test_strncat (void)
   DIAG_PUSH_NEEDS_COMMENT;
 #if __GNUC_PREREQ (7, 0)
   /* GCC 7 warns about the size passed to strncat being larger than
-     the size of the buffer; this is deliberately tested here..  */
+     the size of the buffer; this is deliberately tested here; GCC 8
+     gives a -Warray-bounds warning about this.  */
   DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
 #endif
+  DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds");
   (void) strncat (one, two, 99);
   DIAG_POP_NEEDS_COMMENT;
   equal (one, "ghef", 5);			/* Basic test encore. */
@@ -480,9 +482,11 @@ test_strncat (void)
 #if __GNUC_PREREQ (7, 0)
 	    /* GCC 7 warns about the size passed to strncat being
 	       larger than the size of the buffer; this is
-	       deliberately tested here..  */
+	       deliberately tested here; GCC 8 gives a -Warray-bounds
+	       warning about this.  */
 	    DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
 #endif
+	    DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds");
 	    check (strncat (buf1 + n2, buf2 + n1, ~((size_t) 0) - n4)
 		   == buf1 + n2, ntest);
 	    DIAG_POP_NEEDS_COMMENT;

                 reply	other threads:[~2018-10-22 13:07 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=20181022130216.DA7224399457D@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-stable@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: link
Be 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).