Skip to content

Commit 0cab335

Browse files
committed
ignore some cast-align diagnostics
1 parent 1399d0f commit 0cab335

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

py/objgenerator.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ STATIC mp_obj_t native_gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_k
130130
mp_obj_fun_bc_t *self_fun = MP_OBJ_TO_PTR(self_in);
131131

132132
// Determine start of prelude.
133+
#pragma GCC diagnostic push
134+
#pragma GCC diagnostic ignored "-Wcast-align"
133135
uintptr_t prelude_ptr_index = ((uintptr_t *)self_fun->bytecode)[0];
136+
#pragma GCC diagnostic pop
134137
const uint8_t *prelude_ptr;
135138
if (prelude_ptr_index == 0) {
136139
prelude_ptr = (void *)self_fun->child_table;

py/persistentcode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,16 @@ void mp_native_relocate(void *ri_in, uint8_t *text, uintptr_t reloc_text) {
8787
size_t addr = read_uint(ri->reader);
8888
if ((addr & 1) == 0) {
8989
// Point to somewhere in text
90+
#pragma GCC diagnostic push
91+
#pragma GCC diagnostic ignored "-Wcast-align"
9092
addr_to_adjust = &((uintptr_t *)text)[addr >> 1];
93+
#pragma GCC diagnostic pop
9194
} else {
9295
// Point to somewhere in rodata
96+
#pragma GCC diagnostic push
97+
#pragma GCC diagnostic ignored "-Wcast-align"
9398
addr_to_adjust = &((uintptr_t *)ri->rodata)[addr >> 1];
99+
#pragma GCC diagnostic pop
94100
}
95101
}
96102
op >>= 1;

0 commit comments

Comments
 (0)