sanitizer: support GCC's fallthrough attribute
authorMartin Liska <mliska@suse.cz>
Tue, 3 May 2022 08:54:06 +0000 (10:54 +0200)
committerMartin Liska <mliska@suse.cz>
Tue, 3 May 2022 09:30:13 +0000 (11:30 +0200)
Fixes:
sanitizer_stack_store.cpp:257:13: warning: this statement may fall through [-Wimplicit-fallthrough=]

when being built with GCC.

Differential Revision: https://reviews.llvm.org/D124832

compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h

index 924578b..95a80b4 100644 (file)
@@ -259,7 +259,9 @@ typedef u64 tid_t;
 # define NOEXCEPT throw()
 #endif
 
-#if __has_cpp_attribute(clang::fallthrough)
+#if __has_cpp_attribute(fallthrough)
+#  define FALLTHROUGH [[fallthrough]]
+#elif __has_cpp_attribute(clang::fallthrough)
 #  define FALLTHROUGH [[clang::fallthrough]]
 #else
 #  define FALLTHROUGH