@@ -71,7 +71,11 @@ static inline mp_obj_t mp_obj_new_fun_viper(const void *fun_data, const mp_modul
71
71
72
72
static inline const uint8_t * mp_obj_fun_native_get_prelude_ptr (const mp_obj_fun_bc_t * fun_native ) {
73
73
// Obtain a pointer to the start of the function prelude, based on prelude_ptr_index.
74
+ // CIRCUITPY-CHANGE: prevent warning
75
+ #pragma GCC diagnostic push
76
+ #pragma GCC diagnostic ignored "-Wcast-align"
74
77
uintptr_t prelude_ptr_index = ((uintptr_t * )fun_native -> bytecode )[0 ];
78
+ #pragma GCC diagnostic pop
75
79
const uint8_t * prelude_ptr ;
76
80
if (prelude_ptr_index == 0 ) {
77
81
prelude_ptr = (const uint8_t * )fun_native -> child_table ;
@@ -88,13 +92,21 @@ static inline void *mp_obj_fun_native_get_function_start(const mp_obj_fun_bc_t *
88
92
89
93
static inline void * mp_obj_fun_native_get_generator_start (const mp_obj_fun_bc_t * fun_native ) {
90
94
// Obtain a pointer to the start of the generator executable machine code.
95
+ // CIRCUITPY-CHANGE: prevent warning
96
+ #pragma GCC diagnostic push
97
+ #pragma GCC diagnostic ignored "-Wcast-align"
91
98
uintptr_t start_offset = ((uintptr_t * )fun_native -> bytecode )[1 ];
99
+ #pragma GCC diagnostic pop
92
100
return MICROPY_MAKE_POINTER_CALLABLE ((void * )(fun_native -> bytecode + start_offset ));
93
101
}
94
102
95
103
static inline void * mp_obj_fun_native_get_generator_resume (const mp_obj_fun_bc_t * fun_native ) {
96
104
// Obtain a pointer to the resume location of the generator executable machine code.
105
+ // CIRCUITPY-CHANGE: prevent warning
106
+ #pragma GCC diagnostic push
107
+ #pragma GCC diagnostic ignored "-Wcast-align"
97
108
return MICROPY_MAKE_POINTER_CALLABLE ((void * )& ((uintptr_t * )fun_native -> bytecode )[2 ]);
109
+ #pragma GCC diagnostic pop
98
110
}
99
111
100
112
#endif
0 commit comments