mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
[CK-TILE] Guard against compiler lexer diagnostic (#3444)
* [CK-TILE] Guard against compiler lexer diagnostic A recent change to Clang added a lexer-level diagnostic about that C2y language feature. Since that is lexer level, the `__extension__` compiler built-in does not work as it is only respected *after* the lexer when parsing. This change adds guarding pragmas to disable the diagnostic in the lexer and not lead to warnings being treated as errors. * Fixing still existing build issue Once the one warning was removed, another one poppoed up. Both are related to the same c2y feature. Thus, ignoring both. * clang-format handling --------- Co-authored-by: Illia Silin <98187287+illsilin@users.noreply.github.com>
This commit is contained in:
@@ -74,6 +74,12 @@ class ProfilerOperationRegistry final
|
||||
#define PP_CONCAT(x, y) PP_CONCAT_IMPL(x, y)
|
||||
#define PP_CONCAT_IMPL(x, y) x##y
|
||||
|
||||
#define REGISTER_PROFILER_OPERATION(name, description, operation) \
|
||||
__extension__ static const bool PP_CONCAT(operation_registration_result_, __COUNTER__) = \
|
||||
::ProfilerOperationRegistry::GetInstance().Add(name, description, operation)
|
||||
// clang-format off
|
||||
#define REGISTER_PROFILER_OPERATION(name, description, operation) \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wpre-c2y-compat\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wc2y-extensions\"") static const bool \
|
||||
PP_CONCAT(operation_registration_result_, __COUNTER__) = \
|
||||
::ProfilerOperationRegistry::GetInstance().Add(name, description, operation) \
|
||||
_Pragma("clang diagnostic pop")
|
||||
// clang-format on
|
||||
|
||||
Reference in New Issue
Block a user