Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit 890c67484bbccda1523b739db31d6f84e8c1af1c Author: Sven Eckelmann sven@narfation.org Date: Sat Nov 9 10:53:13 2019 +0100
batman-adv: Use GCC attribute for fallthrough compat
The /* fallthrough */ comment in a define doesn't work in all situations for GCC 8.3.0. The attribute works a lot better but is only supported for GCC 7 (and higher).
Signed-off-by: Sven Eckelmann sven@narfation.org
890c67484bbccda1523b739db31d6f84e8c1af1c compat-include/linux/compiler.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/compat-include/linux/compiler.h b/compat-include/linux/compiler.h index a4704209..95ded26c 100644 --- a/compat-include/linux/compiler.h +++ b/compat-include/linux/compiler.h @@ -31,7 +31,11 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
#ifndef fallthrough -#define fallthrough do {} while (0) /* fallthrough */ +#if __GNUC__ > 7 && !defined(__CHECKER__) +# define fallthrough __attribute__((__fallthrough__)) +#else +# define fallthrough do {} while (0) /* fallthrough */ +#endif #endif
#endif /* < KERNEL_VERSION(5, 4, 0) */