diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h --- a/openmp/runtime/src/kmp_os.h +++ b/openmp/runtime/src/kmp_os.h @@ -345,6 +345,9 @@ // Use a function like macro to imply that it must be followed by a semicolon #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) #define KMP_FALLTHROUGH() [[fallthrough]] +// icc cannot properly tell this attribute is absent so force off +#elif KMP_COMPILER_ICC +#define KMP_FALLTHROUGH() ((void)0) #elif __has_cpp_attribute(clang::fallthrough) #define KMP_FALLTHROUGH() [[clang::fallthrough]] #elif __has_attribute(fallthrough) || __GNUC__ >= 7 diff --git a/openmp/tools/archer/ompt-tsan.cpp b/openmp/tools/archer/ompt-tsan.cpp --- a/openmp/tools/archer/ompt-tsan.cpp +++ b/openmp/tools/archer/ompt-tsan.cpp @@ -42,6 +42,9 @@ // Use a function like macro to imply that it must be followed by a semicolon #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough) #define KMP_FALLTHROUGH() [[fallthrough]] +// icc cannot properly tell this attribute is absent so force off +#elif defined(__INTEL_COMPILER) +#define KMP_FALLTHROUGH() ((void)0) #elif __has_cpp_attribute(clang::fallthrough) #define KMP_FALLTHROUGH() [[clang::fallthrough]] #elif __has_attribute(fallthrough) || __GNUC__ >= 7