aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-06-14 14:20:00 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-06-14 14:20:00 +0000
commit35ebb6b0c48bc671d9c54e089884f9bf6fca540e (patch)
tree16d013c07c6d8d869f6ff0a6dde474bc7f2cac23 /string
parentaarch64: Use an ifunc/VDSO to implement gettimeofday in shared glibc. (diff)
downloadglibc-35ebb6b0c48bc671d9c54e089884f9bf6fca540e.tar.gz
glibc-35ebb6b0c48bc671d9c54e089884f9bf6fca540e.tar.bz2
glibc-35ebb6b0c48bc671d9c54e089884f9bf6fca540e.zip
Ignore -Wrestrict for one strncat test.
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.
Diffstat (limited to 'string')
-rw-r--r--string/tester.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/string/tester.c b/string/tester.c
index 2bb38bfe23..601eb01b55 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)