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 <michael.qiu@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
[Thomas: apply same fix to ppc_64]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
}
#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)
}
#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)