Skip to content

Commit 7b15517

Browse files
NSProgrammerfacebook-github-bot
authored andcommitted
Address compiler switch errors/warnings (ExecuteTorch) (pytorch#15543)
Summary: Make improvements so that it is safe to use the `-Wswitch-enum` compiler error in a project consuming RN Reviewed By: shoumikhin Differential Revision: D86070193
1 parent 96189bf commit 7b15517

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
@@ -918,6 +918,7 @@ struct promote_types {
918918
const auto& _st = TYPE; \
919919
constexpr const char* et_switch_name = NAME; \
920920
(void)et_switch_name; /* Suppress unused var */ \
921+
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wswitch-enum") \
921922
switch (_st) { \
922923
__VA_ARGS__ \
923924
default: \
@@ -928,6 +929,7 @@ struct promote_types {
928929
::executorch::runtime::toString(_st), \
929930
et_switch_name); \
930931
} \
932+
C10_DIAGNOSTIC_POP() \
931933
}()
932934

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

0 commit comments

Comments
 (0)