From 9ef7e0d491fa23c9b3a3f81a534698cce35bf146 Mon Sep 17 00:00:00 2001 From: Tarun Karuturi Date: Tue, 23 Jul 2024 08:01:25 -0700 Subject: [PATCH] Fix log.cpp when compiled with `executorch.enable_et_log=false` (#4358) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/4358 Currently, the ASR execution fails with the following error: `xplat/executorch/runtime/platform/log.cpp:21:25: error: unused variable 'kMaxLogMessageLength' [-Werror,-Wunused-const-variable]` (P1484525874). This diff marks kMaxLogMessageLength as `maybe_unused`. Differential Revision: D59641404 --- runtime/platform/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/platform/log.cpp b/runtime/platform/log.cpp index c60b47392eb..c23ba54a649 100644 --- a/runtime/platform/log.cpp +++ b/runtime/platform/log.cpp @@ -18,7 +18,7 @@ namespace executor { namespace internal { /// Maximum length of a log message. -static constexpr size_t kMaxLogMessageLength = 256; +__ET_UNUSED static constexpr size_t kMaxLogMessageLength = 256; /** * Get the current timestamp to construct a log event.