Skip to content

Commit 86bcca1

Browse files
NSProgrammerfacebook-github-bot
authored andcommitted
Address compiler switch errors/warnings (ExecuteTorch)
Summary: Make improvements so that it is safe to use the `-Wswitch-enum` compiler error in a project consuming RN Differential Revision: D86070193
1 parent 73b6918 commit 86bcca1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runtime/core/exec_aten/util/scalar_type_util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ struct promote_types {
915915
const auto& _st = TYPE; \
916916
constexpr const char* et_switch_name = NAME; \
917917
(void)et_switch_name; /* Suppress unused var */ \
918+
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wswitch-enum") \
918919
switch (_st) { \
919920
__VA_ARGS__ \
920921
default: \
@@ -925,6 +926,7 @@ struct promote_types {
925926
::executorch::runtime::toString(_st), \
926927
et_switch_name); \
927928
} \
929+
C10_DIAGNOSTIC_POP() \
928930
}()
929931

930932
#define ET_INTERNAL_SWITCH_CASE_INT_TYPES(CTYPE_ALIAS, ...) \

0 commit comments

Comments
 (0)