]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Ignore -Wrestrict for one strncat test.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 14 Jun 2018 14:20:00 +0000 (14:20 +0000)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 22 Oct 2018 12:15:29 +0000 (14:15 +0200)
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.

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

(cherry picked from commit 35ebb6b0c48bc671d9c54e089884f9bf6fca540e)

ChangeLog
string/tester.c

index 61a3c872a5af6c917f28de519efb739d216be9e5..65633dbc7fb473e16d2f8ea7479b30738fea23fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * string/tester.c (test_strncat) [__GNUC_PREREQ (7, 0)]: Also
+       ignore -Wrestrict for one test.
+
 2017-12-18  Joseph Myers  <joseph@codesourcery.com>
 
        * string/tester.c (test_strncat): Also disable -Warray-bounds
index 02ea8e1e16544e5439579be2174cfc856d6441a3..8fdbe3de13bbf8e7c7daf6c0348d971d8cef7621 100644 (file)
@@ -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)