From: Pawel Wodkowski Date: Mon, 15 Dec 2014 16:55:02 +0000 (+0000) Subject: eal: fix unused value warning in memcpy macro X-Git-Tag: spdx-start~9944 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=60a3df650d523bd2e4bb4f77f9278f25f7f1a65c;p=dpdk.git eal: fix unused value warning in memcpy macro GCC 4.5.1 from SUSE throws this error: lib/librte_pmd_enic/enic_main.c:862:2: error: value computed is not used This change use statements in expressions C extension provided by gcc to avoid 'value computed is not used' warning/error when size is not known at compile time. Reported-by: Michael Qiu Signed-off-by: Pawel Wodkowski Acked-by: Michael Qiu [Thomas: apply same fix to ppc_64] Acked-by: Thomas Monjalon --- diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h b/lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h index 31daa0d997..acf7aac237 100644 --- a/lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h @@ -95,9 +95,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src) } #define rte_memcpy(dst, src, n) \ - ((__builtin_constant_p(n)) ? \ + ({ (__builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ - rte_memcpy_func((dst), (src), (n))) + rte_memcpy_func((dst), (src), (n)); }) static inline void * rte_memcpy_func(void *dst, const void *src, size_t n) 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 290c5cd566..fb9eba87c8 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -169,9 +169,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src) } #define rte_memcpy(dst, src, n) \ - ((__builtin_constant_p(n)) ? \ + ({ (__builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ - rte_memcpy_func((dst), (src), (n))) + rte_memcpy_func((dst), (src), (n)); }) static inline void * rte_memcpy_func(void *dst, const void *src, size_t n)