From ee4f27affa2a4cbf940081da4bdfa36d22351461 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 5 Jul 2025 09:34:29 +0100 Subject: [PATCH] py/objcell: Fix printing of cell ID/pointer. On the nanbox build, `o->obj` is a 64-bit type but `%p` formats a 32-bit type, leading to undefined behavior. Print the cell's ID as a hex integer instead. This location was found using an experimental gcc plugin for `mp_printf` error checking. Signed-off-by: Jeff Epler --- py/objcell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objcell.c b/py/objcell.c index 95966c7917..5c030c7405 100644 --- a/py/objcell.c +++ b/py/objcell.c @@ -30,7 +30,7 @@ static void cell_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_cell_t *o = MP_OBJ_TO_PTR(o_in); - mp_printf(print, "obj); + mp_printf(print, "obj); if (o->obj == MP_OBJ_NULL) { mp_print_str(print, "(nil)"); } else {