From patchwork Thu Jun 14 14:20:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 27850 Received: (qmail 59820 invoked by alias); 14 Jun 2018 14:20:38 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 59804 invoked by uid 89); 14 Jun 2018 14:20:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Thu, 14 Jun 2018 14:20:30 +0000 From: Joseph Myers To: Subject: Ignore -Wrestrict for one strncat test [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) 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 * 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)