From: Ferruh Yigit Date: Tue, 13 Jun 2017 16:42:12 +0000 (+0100) Subject: hash: fix icc build X-Git-Tag: spdx-start~3007 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d2e026044522d4a5027ab0689c7a663efcb9c493;p=dpdk.git hash: fix icc build 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 --- diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h index 0f485b8545..b8a0cbefb7 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