From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by sourceware.org (Postfix) with ESMTPS id 92510385702F for ; Mon, 31 Aug 2020 13:29:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92510385702F IronPort-SDR: 107XSS0QIfxDdSW3YMXbeqG1ilc88RerUC3TwqPLP5fB62rK9tmHIsbHxmoOQsmdoDg+38ZEy1 XUZlLzzbPIhhpoXQCkiKR4mCodGLQxX4TtNbyAjpCbyS8UL8/S2GkWd9RkazD6c4AjbcSRHTPg PKg+kGetPyctafvj7MzIANHhI4RtLbuLEeF0q1RzDPPuodJngOTEYVobLjQf+T55upwml3XYpO Xhf0MgJRLtnSZKqXXj2kmqstEO3UUt4OANECO27FmIkJFH1wCGF8W9EEJxBlbJxlmvRsF6hIEz S8o= X-IronPort-AV: E=Sophos;i="5.76,375,1592841600"; d="scan'208";a="150562820" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Aug 2020 21:29:18 +0800 IronPort-SDR: N+VOf5en+tKq8LVuwAsdI/gm1KwPFYJE5nxmFHkPNs5ZW5E5Oc6mOPP7PdGiCPqrSFkL9FFA2M ao801a4dE25Q== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 06:16:46 -0700 IronPort-SDR: WtQRFRuwTzTc3blFEjW7BIBujYe9I+tfX5B9rheoDy7+J0Yguk4PVWUjB/aK6fdNhEA/Ojc2z0 wMwx4q5+5S5A== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 06:29:17 -0700 Date: Mon, 31 Aug 2020 14:29:13 +0100 (BST) From: "Maciej W. Rozycki" To: Florian Weimer , Joseph Myers cc: libc-alpha@sourceware.org, "Maciej W. Rozycki" Subject: Re: [PATCH] string: Fix GCC 11 `-Werror=stringop-overread' error In-Reply-To: <875z8znq8e.fsf@oldenburg2.str.redhat.com> Message-ID: References: <875z8znq8e.fsf@oldenburg2.str.redhat.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: , X-List-Received-Date: Mon, 31 Aug 2020 13:29:21 -0000 On Mon, 31 Aug 2020, Florian Weimer wrote: > > Index: glibc/string/rawmemchr.c > > =================================================================== > > --- glibc.orig/string/rawmemchr.c > > +++ glibc/string/rawmemchr.c > > @@ -31,6 +31,8 @@ RAWMEMCHR (const void *s, int c) > > /* GCC 8 warns about the size passed to memchr being larger than > > PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ > > DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); > > + /* Likewise GCC 11, with a different warning option. */ > > + DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); > > #endif > > I think this needs to be in its own __GNUC_PREREQ block because GCC 7 > does not have -Wstringop-overread. Umm, I never used this feature before and got confused with the version mismatch (7 vs 8) right above: #if __GNUC_PREREQ (7, 0) DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); #endif misleading me into thinking GCC 7 is the version that introduced the `_Pragma' feature we use here. Joseph: has the mismatch been intentional? I have posted v2 now. Maciej