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 5075745E27; Wed, 4 Dec 2024 03:57:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39C3340A73; Wed, 4 Dec 2024 03:57:07 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A808840261 for ; Wed, 4 Dec 2024 03:57:05 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id B1A0D20BCAE3; Tue, 3 Dec 2024 18:57:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B1A0D20BCAE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1733281024; bh=GC+2YMYUffDxANXdGj/5MtynCgkzETRb5Dkj9vbVQsU=; h=From:To:Cc:Subject:Date:From; b=JKPM8AP2GXhdW3BRgnHO6oTZSgseqmCxbNi9tWEcMH/nZwAKrFQEDsftzdn/3ckEj 80duZ1DQkehZ5rNMU69XPMT5emZX9fmhCdJgzkann26bk7Dhm0IM2m4qTc4bxKhNWd IUGvd8ovzjzs+nT/oWc7KhJghQpMh/AIRydxUaSI= From: Andre Muezerie To: Vladimir Medvedkin Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH] lib/fib: remove warning about implicit 64-bit conversion Date: Tue, 3 Dec 2024 18:56:50 -0800 Message-Id: <1733281010-23780-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 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..997b7cc338 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 + (ptrdiff_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