From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 19F6E595A for ; Mon, 2 Mar 2015 12:39:51 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 02 Mar 2015 03:37:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,675,1418112000"; d="scan'208";a="461275840" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.47]) ([10.237.220.47]) by FMSMGA003.fm.intel.com with ESMTP; 02 Mar 2015 03:33:42 -0800 Message-ID: <54F44C03.9010805@intel.com> Date: Mon, 02 Mar 2015 11:39:47 +0000 From: "Gonzalez Monroy, Sergio" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Michael Qiu References: <1425281223-14043-1-git-send-email-michael.qiu@intel.com> In-Reply-To: <1425281223-14043-1-git-send-email-michael.qiu@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: Mon, 02 Mar 2015 11:39:52 -0000 On 02/03/2015 07:27, Michael Qiu wrote: > /i686-native-linuxapp-gcc/include/rte_memcpy.h:592:23: error: > cast from pointer to integer of different size > [-Werror=pointer-to-int-cast] > > dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16; > > Type 'long long' is 64-bit in i686 platform while 'void *' > is 32-bit. > > Signed-off-by: Michael Qiu > --- > lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > index 7b2d382..6565c00 100644 > --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h > @@ -589,12 +589,12 @@ COPY_BLOCK_64_BACK15: > * unaligned copy functions require up to 15 bytes > * backwards access. > */ > - dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16; > + dstofss = 16 - (int)((long)(void *)dst & 0x0F) + 16; You may as well remove the (void *) casting, I don't think it is necessary. > n -= dstofss; > rte_mov32((uint8_t *)dst, (const uint8_t *)src); > src = (const uint8_t *)src + dstofss; > dst = (uint8_t *)dst + dstofss; > - srcofs = (int)((long long)(const void *)src & 0x0F); > + srcofs = (int)((long)(const void *)src & 0x0F); Same here for (const void *) Sergio > > /** > * For aligned copy