Skip to content

Commit 40b304f

Browse files
authored
Fix missing enum values in switch statements
Differential Revision: D85956878 Pull Request resolved: #15515
1 parent 73b6918 commit 40b304f

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

extension/apple/ExecuTorch/Exported/ExecuTorchLog.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ void et_pal_emit_log_message(et_timestamp_t timestamp,
151151
case kFatal:
152152
logType = OS_LOG_TYPE_FAULT;
153153
break;
154+
case kUnknown:
154155
default:
155156
logType = OS_LOG_TYPE_DEFAULT;
156157
break;

extension/tensor/tensor_ptr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
#include <memory>
1414
#include <vector>
1515

16+
#include <c10/macros/Macros.h>
1617
#include <executorch/runtime/core/error.h>
1718
#include <executorch/runtime/core/exec_aten/exec_aten.h>
1819
#include <executorch/runtime/core/exec_aten/util/scalar_type_util.h>
1920

21+
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wswitch-enum")
22+
2023
namespace executorch {
2124
namespace extension {
2225

@@ -478,3 +481,5 @@ runtime::Error resize_tensor_ptr(
478481

479482
} // namespace extension
480483
} // namespace executorch
484+
485+
C10_DIAGNOSTIC_POP()

runtime/core/exec_aten/util/scalar_type_util.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@
2727
#include <limits>
2828
#include <type_traits>
2929

30+
#include <c10/macros/Macros.h>
3031
#include <executorch/runtime/platform/assert.h>
3132

33+
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wswitch-enum")
34+
3235
#ifdef USE_ATEN_LIB
3336
// Note that a lot of the macros/functions defined in this ScalarTypeUtil.h file
3437
// are also defined in c10/core/ScalarType.h, which is included via
@@ -1421,3 +1424,5 @@ using ::executorch::runtime::internal::U1;
14211424
} // namespace internal
14221425
} // namespace executor
14231426
} // namespace torch
1427+
1428+
C10_DIAGNOSTIC_POP()

0 commit comments

Comments
 (0)