From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4108EA059F; Fri, 10 Apr 2020 15:23:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7D2551C1DC; Fri, 10 Apr 2020 15:23:21 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 714821C1D9 for ; Fri, 10 Apr 2020 15:23:19 +0200 (CEST) IronPort-SDR: Rs1mS/+KulIDIVXwRM4nAAnyUJCpLEt76gQKVoylh1I7M7NiYFQ+KyEYMNadb77W4YSnXh9sHP xKfaxImL/tZA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2020 06:23:18 -0700 IronPort-SDR: 9ajV5g3mDl7FgfeMCdXad5r0YV/9yY1Hm2WFUj1BERzQG0kEJtNCntNxD2UtP7QoDMMBvAN6mx jV1ruEGACWaQ== X-IronPort-AV: E=Sophos;i="5.72,366,1580803200"; d="scan'208";a="425884357" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.50.46]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 10 Apr 2020 06:23:14 -0700 Date: Fri, 10 Apr 2020 14:23:10 +0100 From: Bruce Richardson To: Kevin Traynor Cc: dev@dpdk.org, thomas@monjalon.net, ravi1.kumar@amd.com, g.singh@nxp.com, hemant.agrawal@nxp.com, akhil.goyal@nxp.com, johndale@cisco.com, hyonkim@cisco.com, jingjing.wu@intel.com, wenzhuo.lu@intel.com, rmody@marvell.com, shshaikh@marvell.com, matan@mellanox.com, shahafs@mellanox.com, declan.doherty@intel.com, cristian.dumitrescu@intel.com Message-ID: <20200410132310.GA42@bricha3-MOBL.ger.corp.intel.com> References: <20200325141137.7088-1-ktraynor@redhat.com> <20200407162755.6802-1-ktraynor@redhat.com> <1fc82ce4-8cae-fae5-6139-9590ae1f00ef@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1fc82ce4-8cae-fae5-6139-9590ae1f00ef@redhat.com> Subject: Re: [dpdk-dev] [PATCH] build: gcc 10 disable stringop-overflow warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Apr 10, 2020 at 11:51:56AM +0100, Kevin Traynor wrote: > On 07/04/2020 17:27, Kevin Traynor wrote: > > stringop-overflow warns when it sees a possible overflow > > in a string operation. > > > > In the rte_memcpy functions different implementations are > > used depending on the size. stringop-overflow is raised for > > the paths in the function where it sees the static size of the > > src could be overflowed. > > > > However, in reality a correct size argument and in some cases > > dynamic allocation would ensure that this does not happen. > > > > Disable this warning at the top level as it is being raised on > > several components. > > > > For example, in the case below for key, the correct path will be > > chosen in rte_memcpy_generic at runtime based on the size argument > > but as some paths in the function could lead to a cast to 32 bytes > > a warning is raised. > > > > In function ‘_mm256_storeu_si256’, > > inlined from ‘rte_memcpy_generic’ > > at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:315:2, > > inlined from ‘iavf_configure_rss_key’ > > at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:869:10: > > > > /usr/lib/gcc/x86_64-redhat-linux/10/include/avxintrin.h:928:8: > > warning: writing 32 bytes into a region of size 1 [-Wstringop-overflow=] > > 928 | *__P = __A; > > | ~~~~~^~~~~ > > In file included > > from ../drivers/net/iavf/../../common/iavf/iavf_prototype.h:10, > > from ../drivers/net/iavf/iavf.h:9, > > from ../drivers/net/iavf/iavf_vchnl.c:22: > > > > ../drivers/net/iavf/iavf_vchnl.c: > > In function ‘iavf_configure_rss_key’: > > > > ../drivers/net/iavf/../../common/iavf/virtchnl.h:508:5: > > note: at offset 0 to object ‘key’ with size 1 declared here > > 508 | u8 key[1]; /* RSS hash key, packed bytes */ > > | ^~~ > > > > As an alternative, we could remove these warnings for rte_memcpy.h(s) > only. WDYT? > > diff --git a/lib/librte_eal/x86/include/rte_memcpy.h > b/lib/librte_eal/x86/include/rte_memcpy.h > index ba44c4a32..862e0c402 100644 > --- a/lib/librte_eal/x86/include/rte_memcpy.h > +++ b/lib/librte_eal/x86/include/rte_memcpy.h > @@ -19,4 +19,6 @@ > #include > > +#pragma GCC diagnostic ignored "-Wstringop-overflow" > + > #ifdef __cplusplus > extern "C" { Limited disabling is always better than global disabling, so given the choice of the two, +1 for this. /Bruce