From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5BE751F7 for ; Mon, 15 Dec 2014 17:55:21 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 15 Dec 2014 08:53:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,580,1413270000"; d="scan'208";a="624054854" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 15 Dec 2014 08:55:11 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sBFGtBC5024467; Mon, 15 Dec 2014 16:55:11 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sBFGtBAM016450; Mon, 15 Dec 2014 16:55:11 GMT Received: (from mkjastrx@localhost) by sivswdev01.ir.intel.com with id sBFGtA4h016445; Mon, 15 Dec 2014 16:55:10 GMT From: Michal Jastrzebski To: dev@dpdk.org Date: Mon, 15 Dec 2014 16:55:02 +0000 Message-Id: <1418662502-16406-1-git-send-email-michalx.k.jastrzebski@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] fix rte_memcpy() macro: avoid unused value warning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2014 16:55:22 -0000 From: Pawel Wodkowski 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. Comments on possible side effects are welcome an tests are welcome. Reported-by: Qiu, Michael Signed-off-by: Pawel Wodkowski --- .../common/include/arch/x86/rte_memcpy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 290c5cd..c3e8b81 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) -- 1.7.9.5