From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id C088B2C38 for ; Tue, 5 Apr 2016 16:08:28 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id u206so5972467wme.1 for ; Tue, 05 Apr 2016 07:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FI33LM+PxHFI/FisrZ3Z0C4DHAvkS1fP0eQKEPwA/jU=; b=GAb+tltG53BZCmvgRJiOvaZjmw6SDr+cf1hXcqe3oClFQxjXyNeD6qhswPnSuaQij1 E1R784OQvq8XVvz2cEq5y0Kui+z6sB8fSrEDsc/UY8X/1UPdXKlpacKojVEm02NeNIRP Cu31ASZyiTuJpXL9fT06SP11BVqPx9CcNcxRgcm3+g/k7mO7B8xdhbZBWslCdB+dRaf3 ONRWu/rLZTHjD+FxZLw3eRwjs8ghAVkETFM2Y219J0M1PcBDRAdd1VxLbQa8vff7dvJb cGRyl/Nyt3tZ2nHwmV5VDciHLAmgxGMDTmtzZ7KVGdMs0iyNQ2Xzi7LBMlYpXbvh1FMf sTDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FI33LM+PxHFI/FisrZ3Z0C4DHAvkS1fP0eQKEPwA/jU=; b=RFzbaunsUsrnEpYQVEkRB3ODhj+KHBCTikSUmRbUsaW47ro3xle6cowc/dOigGtn63 hP+bypuAeyb++XuMlCWy01GCeWl4JkTM+BYSjrddkY+iBwD0CBCN7bnPE1Bg4QYrjgps cUED93PKFUYSJbpOz4UBE9seycavfL/oMDymdpXX14RqpmGeBD0aqX8+LWkoE9RgH/qO YhhhTNC/ESKKB1AGgpDlsIsRMBZwvDDvpU0/JzBs6jIZwhysYb18KF3/R2OhtI809roA AHn0mz4s1baC6CnGHK+e5MUctIko3UzJTaUmhulvMv9zqPM8iudFR0KBZ4pAgzk9FCwR 1sJw== X-Gm-Message-State: AD7BkJKPaT0dFfhLZr3/vWGoCfyxKGLakHq6ypU8xzovLaYkNeF0Px0+Mr/rtR7pLdDLLF5/ X-Received: by 10.194.158.226 with SMTP id wx2mr11101607wjb.91.1459865308638; Tue, 05 Apr 2016 07:08:28 -0700 (PDT) Received: from 6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id i11sm10317259wjn.36.2016.04.05.07.08.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2016 07:08:27 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Cc: Bruce Richardson , Thomas Monjalon Date: Tue, 5 Apr 2016 16:08:01 +0200 Message-Id: <1459865290-10248-2-git-send-email-adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com> References: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com> Subject: [dpdk-dev] [PATCH 01/10] lib: add extension keyword to braced-groups within expressions 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: Tue, 05 Apr 2016 14:08:29 -0000 Exported header files used by applications should allow the strictest compiler flags. Language extensions used in many places must be explicitly marked or removed to avoid warnings and compilation failures. This commit prevents the following errors: error: ISO C forbids braced-groups within expressions Signed-off-by: Adrien Mazarguil --- lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h | 3 ++- lib/librte_eal/common/include/arch/ppc_64/rte_memcpy.h | 3 ++- lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 4 ++-- lib/librte_eal/common/include/arch/x86/rte_vect.h | 6 ++++-- lib/librte_eal/common/include/rte_common.h | 6 ++++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h b/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h index 988125b..a4f954a 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h +++ b/lib/librte_eal/common/include/arch/arm/rte_memcpy_32.h @@ -148,7 +148,8 @@ rte_mov256(uint8_t *dst, const uint8_t *src) } #define rte_memcpy(dst, src, n) \ - ({ (__builtin_constant_p(n)) ? \ + __extension__ ({ \ + __builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ rte_memcpy_func((dst), (src), (n)); }) 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 acf7aac..a71fb13 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,7 +95,8 @@ rte_mov256(uint8_t *dst, const uint8_t *src) } #define rte_memcpy(dst, src, n) \ - ({ (__builtin_constant_p(n)) ? \ + __extension__ ({ \ + __builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ rte_memcpy_func((dst), (src), (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 f463ab3..68b7818 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -650,7 +650,7 @@ rte_mov256(uint8_t *dst, const uint8_t *src) * - __m128i ~ must be pre-defined */ #define MOVEUNALIGNED_LEFT47_IMM(dst, src, len, offset) \ -({ \ +__extension__ ({ \ int tmp; \ while (len >= 128 + 16 - offset) { \ xmm0 = _mm_loadu_si128((const __m128i *)((const uint8_t *)src - offset + 0 * 16)); \ @@ -711,7 +711,7 @@ rte_mov256(uint8_t *dst, const uint8_t *src) * - __m128i ~ used in MOVEUNALIGNED_LEFT47_IMM must be pre-defined */ #define MOVEUNALIGNED_LEFT47(dst, src, len, offset) \ -({ \ +__extension__ ({ \ switch (offset) { \ case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break; \ case 0x02: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x02); break; \ diff --git a/lib/librte_eal/common/include/arch/x86/rte_vect.h b/lib/librte_eal/common/include/arch/x86/rte_vect.h index b698797..2836f2c 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_vect.h +++ b/lib/librte_eal/common/include/arch/x86/rte_vect.h @@ -106,7 +106,8 @@ typedef union rte_ymm { #endif /* __AVX__ */ #ifdef RTE_ARCH_I686 -#define _mm_cvtsi128_si64(a) ({ \ +#define _mm_cvtsi128_si64(a) \ +__extension__ ({ \ rte_xmm_t m; \ m.x = (a); \ (m.u64[0]); \ @@ -117,7 +118,8 @@ typedef union rte_ymm { * Prior to version 12.1 icc doesn't support _mm_set_epi64x. */ #if (defined(__ICC) && __ICC < 1210) -#define _mm_set_epi64x(a, b) ({ \ +#define _mm_set_epi64x(a, b) \ +__extension__ ({ \ rte_xmm_t m; \ m.u64[0] = b; \ m.u64[1] = a; \ diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 332f2a4..477472b 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -268,7 +268,8 @@ rte_align64pow2(uint64_t v) /** * Macro to return the minimum of two numbers */ -#define RTE_MIN(a, b) ({ \ +#define RTE_MIN(a, b) \ + __extension__ ({ \ typeof (a) _a = (a); \ typeof (b) _b = (b); \ _a < _b ? _a : _b; \ @@ -277,7 +278,8 @@ rte_align64pow2(uint64_t v) /** * Macro to return the maximum of two numbers */ -#define RTE_MAX(a, b) ({ \ +#define RTE_MAX(a, b) \ + __extension__ ({ \ typeof (a) _a = (a); \ typeof (b) _b = (b); \ _a > _b ? _a : _b; \ -- 2.1.4