From 4933f27d8d6c00609ccc704bfdf7c34cd019ab7e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 16 Sep 2020 02:59:28 +0000 Subject: [PATCH] scst: Make scst/include/backport.h again compatible with MOFED Fix the following build failure on RHEL 7 + MOFED 5.0: In file included from :0:0: /usr/src/ofa_kernel/default/include/linux/compat-2.6.h:40:29: warning: "__GCC4_has_attribute___fallthrough__" is not defined [-Wundef] # define __has_attribute(x) __GCC4_has_attribute_##x ^ /usr/src/packages/BUILD/scst-3.5.0.7946/iscsi-scst/kernel/isert-scst/../../../scst/include/backport.h:250:5: note: in expansion of macro '__has_attribute' #if __has_attribute(__fallthrough__) Reported-by: Chesnokov Gleb git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9163 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 8ffa83254..3273b9420 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -246,13 +246,14 @@ static inline void cpu_to_be32_array(__be32 *dst, const u32 *src, size_t len) * pseudo keyword for switch/case use") # v5.4 */ #ifndef fallthrough -#ifdef __has_attribute +#if __GNUC__ >= 5 #if __has_attribute(__fallthrough__) #define fallthrough __attribute__((__fallthrough__)) #else #define fallthrough do {} while (0) /* fallthrough */ #endif #else +/* gcc 4.x doesn't support __has_attribute() */ #define fallthrough do {} while (0) /* fallthrough */ #endif #endif