Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/nolibc: use __fallthrough__ rather than fallthrough

Use the version of the attribute with underscores to avoid issues if
fallthrough has been defined by another header file already.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

authored by

Benjamin Berg and committed by
Thomas Weißschuh
2cb6cc83 fbd1b7f6

+2 -2
+2 -2
tools/include/nolibc/compiler.h
··· 41 41 # define __no_stack_protector __attribute__((__optimize__("-fno-stack-protector"))) 42 42 #endif /* __nolibc_has_attribute(no_stack_protector) */ 43 43 44 - #if __nolibc_has_attribute(fallthrough) 45 - # define __nolibc_fallthrough do { } while (0); __attribute__((fallthrough)) 44 + #if __nolibc_has_attribute(__fallthrough__) 45 + # define __nolibc_fallthrough do { } while (0); __attribute__((__fallthrough__)) 46 46 #else 47 47 # define __nolibc_fallthrough do { } while (0) 48 48 #endif /* __nolibc_has_attribute(fallthrough) */