File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1440,6 +1440,15 @@ typedef double mp_float_t;
1440
1440
#define MP_UNLIKELY (x ) __builtin_expect((x), 0)
1441
1441
#endif
1442
1442
1443
+ // To annotate that code is unreachable
1444
+ #ifndef MP_UNREACHABLE
1445
+ #if defined(__GNUC__ )
1446
+ #define MP_UNREACHABLE __builtin_unreachable();
1447
+ #else
1448
+ #define MP_UNREACHABLE for (;;);
1449
+ #endif
1450
+ #endif
1451
+
1443
1452
#ifndef MP_HTOBE16
1444
1453
#if MP_ENDIANNESS_LITTLE
1445
1454
# define MP_HTOBE16 (x ) ((uint16_t)( (((x) & 0xff) << 8) | (((x) >> 8) & 0xff) ))
Original file line number Diff line number Diff line change @@ -127,11 +127,7 @@ NORETURN void nlr_jump(void *val) {
127
127
: // clobbered registers
128
128
);
129
129
130
- #if defined(__GNUC__ )
131
- __builtin_unreachable ();
132
- #else
133
- for (;;); // needed to silence compiler warning
134
- #endif
130
+ MP_UNREACHABLE
135
131
}
136
132
137
133
#endif // MICROPY_NLR_THUMB
You can’t perform that action at this time.
0 commit comments