From a42eb3d50804a5b3050b9bd3eaea956b8d981d36 Mon Sep 17 00:00:00 2001 From: Sergey Balabanov Date: Wed, 12 Aug 2015 12:11:04 +0300 Subject: [PATCH] mbuf: fix explicit cast to build C++ app When DPDK is being compiled in C++ project using g++ then 'invalid conversion from' error appears. Added explicit typecast on function return to get rid of the error. Fixes: 7755baae8378 ("mbuf: silence warning on pointer arithmetic") Signed-off-by: Sergey Balabanov Acked-by: Olivier Matz --- lib/librte_mbuf/rte_mbuf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index c3b8c98913..8c2db1bfcf 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -882,7 +882,7 @@ static inline uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp); static inline struct rte_mbuf * rte_mbuf_from_indirect(struct rte_mbuf *mi) { - return RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) + mi->priv_size); + return (struct rte_mbuf *)RTE_PTR_SUB(mi->buf_addr, sizeof(*mi) + mi->priv_size); } /** -- 2.20.1