From patchwork Mon Sep 7 17:45:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1359115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BlbL817s7z9sRK for ; Tue, 8 Sep 2020 03:46:08 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 635523947438; Mon, 7 Sep 2020 17:46:05 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 4682E39450E5 for ; Mon, 7 Sep 2020 17:46:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4682E39450E5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: Sqxtv32myDFz96w2j0oOESOGyazY3khgByETdog9ZhekB8EBDzyAKwCDRrAgXfL05sz5+3DSvs jKFTaJh8edLU/XH9iTwRAmpy8azGE7uKV9XtZrDZlYE0xK9gmIB3Ko6u3GrizQOjRVjZbwBIyQ eFPVcxzvrgYX8MeZef3gzOwV6nogMEFYOu0QeEjLHW+mIq4H5mJBra94GgljGin3V9K8CSIT18 5b1c4wH8iw8b5PXm2pGYaMqZwWkxzqlQBuVgKyNIm3L8W90zdQLSMRC1jgDdx3Npim+RaCVYg6 hCc= X-IronPort-AV: E=Sophos;i="5.76,402,1592899200"; d="scan'208";a="54841108" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 07 Sep 2020 09:46:02 -0800 IronPort-SDR: akTctR+6nFQw1zcVr2G7/BkBBiCC/1ltMzS8fXQ72nYqpSer8ir+HuC6eGJIB894Z3Gd6NF6qA W7eIH5qIsRnC6kSek4KrTeG3EaBkW/HL24nMhsbghQSf0Ha5jnaesCqpS3oL3CMtlLHYa1hAGR /L7h8zGAva9GtdWxwvVjNKClxpqVvl+1FzEPXoTA3jjKxp8rQ2Jkp0XwC8A3SGtgh3wgKOrmsI Wkgi8rNwI7ekV6t4nvbyMGjUn2Qzw3RO6K6XLZJkSV/t2WBhtMoWyrg2iYJKvcz2QFmBA91Lqh O8g= Date: Mon, 7 Sep 2020 17:45:57 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: Disable -Wstringop-overread for some string tests Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3132.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Similarly to Maciej's changes to fix the build of rawmemchr in the presence of GCC 11's -Wstringop-overread, also disable that option in two string function tests that have similar warnings and other string function warnings already disabled. Tested with build-many-glibcs.py for aarch64-linux-gnu and arm-linux-gnueabi that it fixes building the glibc testsuite. diff --git a/string/tester.c b/string/tester.c index bcd7148c2e..b7acf29c81 100644 --- a/string/tester.c +++ b/string/tester.c @@ -47,6 +47,9 @@ DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow="); #if __GNUC_PREREQ (8, 0) DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation"); #endif +#if __GNUC_PREREQ (11, 0) +DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); +#endif #define STREQ(a, b) (strcmp((a), (b)) == 0) diff --git a/string/tst-cmp.c b/string/tst-cmp.c index 13af0fcb83..e73025cfdf 100644 --- a/string/tst-cmp.c +++ b/string/tst-cmp.c @@ -104,6 +104,10 @@ strncmp_max (const char *left, const char *right) /* GCC 9 warns about the size passed to strncmp being larger than PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow="); +#endif +#if __GNUC_PREREQ (11, 0) + /* Likewise GCC 11, with a different warning option. */ + DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); #endif return strncmp (left, right, SIZE_MAX); DIAG_POP_NEEDS_COMMENT; @@ -117,6 +121,10 @@ strncasecmp_max (const char *left, const char *right) /* GCC 9 warns about the size passed to strncasecmp being larger than PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ DIAG_IGNORE_NEEDS_COMMENT (9, "-Wstringop-overflow="); +#endif +#if __GNUC_PREREQ (11, 0) + /* Likewise GCC 11, with a different warning option. */ + DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); #endif return strncasecmp (left, right, SIZE_MAX); DIAG_POP_NEEDS_COMMENT;