From patchwork Tue Jun 13 16:42:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 25301 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 429507CBC; Tue, 13 Jun 2017 18:42:41 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 1EEAA567C; Tue, 13 Jun 2017 18:42:28 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 13 Jun 2017 09:42:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.39,338,1493708400"; d="scan'208"; a="1140846299" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by orsmga001.jf.intel.com with ESMTP; 13 Jun 2017 09:42:20 -0700 From: Ferruh Yigit To: Bruce Richardson , Pablo de Lara Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org Date: Tue, 13 Jun 2017 17:42:12 +0100 Message-Id: <20170613164212.42374-5-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170613164212.42374-1-ferruh.yigit@intel.com> References: <20170613164212.42374-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH 5/5] hash: fix icc build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" build error with icc version 17.0.4 (gcc version 7.0.0 compatibility): In file included from .../dpdk/lib/librte_hash/rte_fbk_hash.h(59), from .../dpdk/lib/librte_hash/rte_fbk_hash.c(54): .../dpdk/x86_64-native-linuxapp-icc/include/rte_hash_crc.h(480): error #1292: unknown attribute "fallthrough" __attribute__ ((fallthrough)); ^ In file included from .../dpdk/lib/librte_hash/rte_fbk_hash.h(59), from .../dpdk/lib/librte_hash/rte_fbk_hash.c(54): .../dpdk/x86_64-native-linuxapp-icc/include/rte_hash_crc.h(486): error #1292: unknown attribute "fallthrough" __attribute__ ((fallthrough)); ^ This code patch hit when gcc > 7 installed and ICC doesn't recognize fallthrough attribute. Fixed by disabling code when compiled with ICC. Fixes: 3dfb9facb055 ("lib: add switch fall-through comments") Signed-off-by: Ferruh Yigit --- This can be merged with the patch fixes gcc build error. Cc: Bruce Richardson --- lib/librte_hash/rte_hash_crc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 0f485b854..b8a0cbefb 100644 --- a/lib/librte_hash/rte_hash_crc.h +++ b/lib/librte_hash/rte_hash_crc.h @@ -476,13 +476,13 @@ rte_hash_crc_set_alg(uint8_t alg) case CRC32_SSE42_x64: if (! rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T)) alg = CRC32_SSE42; -#if __GNUC__ >= 7 +#if __GNUC__ >= 7 && !defined(RTE_TOOLCHAIN_ICC) __attribute__ ((fallthrough)); #endif case CRC32_SSE42: if (! rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2)) alg = CRC32_SW; -#if __GNUC__ >= 7 +#if __GNUC__ >= 7 && !defined(RTE_TOOLCHAIN_ICC) __attribute__ ((fallthrough)); #endif #endif