From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F7EC45E3A; Thu, 5 Dec 2024 16:38:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5E4C40648; Thu, 5 Dec 2024 16:38:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E0630402E3 for ; Thu, 5 Dec 2024 16:38:18 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 2AF8020BCAD0; Thu, 5 Dec 2024 07:38:18 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2AF8020BCAD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733413098; bh=MVHTjy7jfAVdONKGoVrVk4a0QQyRvvgD/JA+PQR215o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WmGK8cJ5RzukeHaAK7xDcXJ9bc7O1FYLEVmhNG4eMFs/716AdHxZ0csrsvFFhbsCn BTibd/H9mjmw1Z6LkyuiqdCgF52Gxm3Nte5wgLi0Sx1NynGWghnZNyIAL3kMCq3OSg pvNz0mXicx6rDuaqXTEudpfsou2LUbtf8JNvGeaY= From: Andre Muezerie To: dev@dpdk.org Cc: Andre Muezerie Subject: [PATCH v2] lib/fib: remove warning about implicit 64-bit conversion Date: Thu, 5 Dec 2024 07:38:12 -0800 Message-Id: <1733413092-30024-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1733281010-23780-1-git-send-email-andremue@linux.microsoft.com> References: <1733281010-23780-1-git-send-email-andremue@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org MSVC issues the warning below: ../lib/fib/trie.c(341): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) The fix is to cast the result explicitly to ptrdiff_t since it is used in pointer arithmetic. Signed-off-by: Andre Muezerie --- lib/fib/trie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fib/trie.c b/lib/fib/trie.c index 4893f6c636..959cb8803c 100644 --- a/lib/fib/trie.c +++ b/lib/fib/trie.c @@ -338,7 +338,7 @@ write_edge(struct rte_trie_tbl *dp, const uint8_t *ip_part, uint64_t next_hop, if (ret < 0) return ret; if (edge == LEDGE) { - write_to_dp((uint8_t *)p + (1 << dp->nh_sz), + write_to_dp((uint8_t *)p + ((uintptr_t)1 << dp->nh_sz), next_hop << 1, dp->nh_sz, UINT8_MAX - *ip_part); } else { write_to_dp(get_tbl_p_by_idx(dp->tbl8, tbl8_idx * -- 2.47.0.vfs.0.3