From: Olga Shern Date: Wed, 13 Jul 2016 14:33:22 +0000 (+0200) Subject: net/mlx5: work around gcc error X-Git-Tag: spdx-start~6159 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cd8ec06ac04f71077bfc89c1a7e55ba48cf4e911;p=dpdk.git net/mlx5: work around gcc error RHEL 7.1's GCC for POWER8 reports the following error in one rte_memcpy() macro call by mlx5: error: array subscript is above array bounds [-Werror=array-bounds] It appears to be a GCC bug which can be worked around by making parentheses more explicit. Signed-off-by: Olga Shern Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 615de9452c..fce3381ae8 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -472,8 +472,8 @@ mlx5_wqe_write_inline_vlan(struct txq *txq, volatile union mlx5_wqe *wqe, (uint8_t *)addr, 12); rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 12, &vlan, sizeof(vlan)); - rte_memcpy((uint8_t *)(uintptr_t)wqe->inl.eseg.inline_hdr_start + 16, - ((uint8_t *)addr + 12), 2); + rte_memcpy((uint8_t *)((uintptr_t)wqe->inl.eseg.inline_hdr_start + 16), + (uint8_t *)(addr + 12), 2); addr += MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan); length -= MLX5_ETH_VLAN_INLINE_HEADER_SIZE - sizeof(vlan); size = (sizeof(wqe->inl.ctrl.ctrl) +