From 6e9cfb79f32143dc7184a1355e35a435a571c650 Mon Sep 17 00:00:00 2001 From: Remy Noel Date: Sun, 15 Oct 2017 18:03:46 +0200 Subject: kern/macros: new __fallthrough macro --- kern/macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kern/macros.h') diff --git a/kern/macros.h b/kern/macros.h index d09eca40..23ad4d22 100644 --- a/kern/macros.h +++ b/kern/macros.h @@ -106,4 +106,13 @@ moo_print(const char *s) #define __used __attribute__((used)) #endif +#ifndef __fallthrough +#if __GNUC__ >= 7 +#define __fallthrough __attribute__((fallthrough)) +#else +/* TODO: clang 6 might add support for -Wimplicit-fallthrough */ +#define __fallthrough +#endif +#endif + #endif /* _KERN_MACROS_H */ -- cgit v1.2.3