From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 08F856A94 for ; Mon, 15 Dec 2014 16:44:32 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 15 Dec 2014 07:42:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="498957942" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga003.jf.intel.com with ESMTP; 15 Dec 2014 07:40:19 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.213]) by IRSMSX154.ger.corp.intel.com ([169.254.12.18]) with mapi id 14.03.0195.001; Mon, 15 Dec 2014 15:44:26 +0000 From: "Wodkowski, PawelX" To: Thomas Monjalon Thread-Topic: [dpdk-dev] error: value computed is not used Thread-Index: AdASxiisLi704rCnRgagZfyMuDIXlQANP/TQAVaWb4AAALwbsAAEld2AAABHqiAAAXW7AAACyuyQ Date: Mon, 15 Dec 2014 15:44:26 +0000 Message-ID: References: <533710CFB86FA344BFBF2D6802E60286C9D989@SHSMSX101.ccr.corp.intel.com> <3427289.cFFhb9tNHS@xps13> <4008093.EPhAooubXd@xps13> In-Reply-To: <4008093.EPhAooubXd@xps13> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] error: value computed is not used X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 15:44:34 -0000 > > > > And something like this? > > > > > > > > #define rte_memcpy(dst, src, n) \ > > > > - ((__builtin_constant_p(n)) ? \ > > > > + ({ (__builtin_constant_p(n)) ? \ > > > > memcpy((dst), (src), (n)) : \ > > > > - rte_memcpy_func((dst), (src), (n))) > > > > + rte_memcpy_func((dst), (src), (n)); }) > > > > > > What happens to the returned value after this change? > > > ptr =3D rte_memcpy(dst, src, n) + offset: > > > > > https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs > > > > Whole expression should be 'void *' type (like *memcpy()) and it should= work > > as usual (see maxint() example in above link). It is GCC extension. >=20 > OK nice. > I didn't test it on SUSE 11 SP3. I assume you did it? I did not tested this, as this was only proposal. I only run build process = and it pass. Patch proposal will be sent in a while. > Please Pawel, could you send a proper patch quickly? > If nobody disagree, it'll be merged in RC5 today. >=20 > > > > Thomas, can you check build with EXTRA_CFLAG=3D'-Wunused-value'. > > > > > > You mean EXTRA_CFLAGS (with a S). > > > It fails in many locations. > > > What's your point? > > > > I am just asking if this is an typo, error or intend to do statements w= ith no > effects like bellow. > > > > ixgbe_common.c:4429:3: error: statement with no effect [-Werror=3Dunuse= d- > value] > > > > 4426: /* first pull in the header so we know the buffer length */ > > 4427: for (bi =3D 0; bi < dword_len; bi++) { > > 4428: buffer[bi] =3D IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, > bi); > > 4429: IXGBE_LE32_TO_CPUS(&buffer[bi]); // <------ here > > 4430 } >=20 > It's an intent. On big endian CPU, this has an effect. >=20 If you see something what I am not, please ignore this part but for me this= looks like it should be: tmp =3D IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, buffer[bi] =3D IXGBE_LE32_TO_CPUS (tmp); Pawel