From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29165 invoked by alias); 22 Oct 2018 13:07:52 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 29129 invoked by uid 89); 22 Oct 2018 13:07:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Oct 2018 13:07:50 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A554E369C9 for ; Mon, 22 Oct 2018 13:02:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70A976D78F for ; Mon, 22 Oct 2018 13:02:17 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id DA7224399457D; Mon, 22 Oct 2018 15:02:16 +0200 (CEST) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.26 COMMITTED] Disable strncat test array-bounds warnings for GCC 8. User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20181022130216.DA7224399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 Oct 2018 13:02:17 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00015.txt.bz2 From: Joseph Myers 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 * 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;