public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Ignore -Wrestrict for one strncat test [committed]
@ 2018-06-14 14:20 Joseph Myers
  0 siblings, 0 replies; only message in thread
From: Joseph Myers @ 2018-06-14 14:20 UTC (permalink / raw)
  To: libc-alpha

With current GCC mainline, one strncat test involving a size close to
SIZE_MAX results in a -Wrestrict warning that that buffer size would
imply that the two buffers must overlap.  This patch fixes the build
by adding disabling of -Wrestrict (for GCC versions supporting that
option) to the already-present disabling of -Wstringop-overflow= and
-Warray-bounds for this test.

Tested with build-many-glibcs.py that this restores the testsuite
build with GCC mainline for aarch64-linux-gnu.  Committed.

2018-06-14  Joseph Myers  <joseph@codesourcery.com>

	* string/tester.c (test_strncat) [__GNUC_PREREQ (7, 0)]: Also
	ignore -Wrestrict for one test.

diff --git a/string/tester.c b/string/tester.c
index 2bb38bf..601eb01 100644
--- a/string/tester.c
+++ b/string/tester.c
@@ -485,6 +485,10 @@ test_strncat (void)
 	       deliberately tested here; GCC 8 gives a -Warray-bounds
 	       warning about this.  */
 	    DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
+	    /* GCC 9 as of 2018-06-14 warns that the size passed is
+	       large enough that, if it were the actual object size,
+	       the objects would have to overlap.  */
+	    DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict");
 #endif
 	    DIAG_IGNORE_NEEDS_COMMENT (8, "-Warray-bounds");
 	    check (strncat (buf1 + n2, buf2 + n1, ~((size_t) 0) - n4)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-14 14:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 14:20 Ignore -Wrestrict for one strncat test [committed] Joseph Myers

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).