From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C5397106B for ; Tue, 3 Mar 2015 03:02:48 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 02 Mar 2015 18:02:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,679,1418112000"; d="scan'208";a="659527011" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga001.jf.intel.com with ESMTP; 02 Mar 2015 18:02:46 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 3 Mar 2015 10:02:15 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0195.001; Tue, 3 Mar 2015 10:02:13 +0800 From: "Qiu, Michael" To: "Gonzalez Monroy, Sergio" Thread-Topic: [dpdk-dev] [PATCH] librte_eal/common: Fix cast from pointer to integer of different size Thread-Index: AQHQVLpR36xDkGk/nUWW1zBDQTfj3Q== Date: Tue, 3 Mar 2015 02:02:13 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CED569@SHSMSX101.ccr.corp.intel.com> References: <1425281223-14043-1-git-send-email-michael.qiu@intel.com> <54F44C03.9010805@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] librte_eal/common: Fix cast from pointer to integer of different size 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: Tue, 03 Mar 2015 02:02:49 -0000 On 3/2/2015 7:39 PM, Gonzalez Monroy, Sergio wrote:=0A= > On 02/03/2015 07:27, Michael Qiu wrote:=0A= >> /i686-native-linuxapp-gcc/include/rte_memcpy.h:592:23: error:=0A= >> cast from pointer to integer of different size=0A= >> [-Werror=3Dpointer-to-int-cast]=0A= >>=0A= >> dstofss =3D 16 - (int)((long long)(void *)dst & 0x0F) + 16;=0A= >>=0A= >> Type 'long long' is 64-bit in i686 platform while 'void *'=0A= >> is 32-bit.=0A= >>=0A= >> Signed-off-by: Michael Qiu =0A= >> ---=0A= >> lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 4 ++--=0A= >> 1 file changed, 2 insertions(+), 2 deletions(-)=0A= >>=0A= >> diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/l= ibrte_eal/common/include/arch/x86/rte_memcpy.h=0A= >> index 7b2d382..6565c00 100644=0A= >> --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h=0A= >> +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h=0A= >> @@ -589,12 +589,12 @@ COPY_BLOCK_64_BACK15:=0A= >> * unaligned copy functions require up to 15 bytes=0A= >> * backwards access.=0A= >> */=0A= >> - dstofss =3D 16 - (int)((long long)(void *)dst & 0x0F) + 16;=0A= >> + dstofss =3D 16 - (int)((long)(void *)dst & 0x0F) + 16;=0A= > You may as well remove the (void *) casting, I don't think it is necessar= y.=0A= =0A= Yes, you are right. The original type is (void *).=0A= =0A= Thanks,=0A= Michael=0A= >> n -=3D dstofss;=0A= >> rte_mov32((uint8_t *)dst, (const uint8_t *)src);=0A= >> src =3D (const uint8_t *)src + dstofss;=0A= >> dst =3D (uint8_t *)dst + dstofss;=0A= >> - srcofs =3D (int)((long long)(const void *)src & 0x0F);=0A= >> + srcofs =3D (int)((long)(const void *)src & 0x0F);=0A= > Same here for (const void *)=0A= >=0A= > Sergio=0A= >> =0A= >> /**=0A= >> * For aligned copy=0A= >=0A= =0A=