Skip to content

Commit 6832cbd

Browse files
committed
lib/utils/pyexec: Fix compilation warning of type vs format mismatch.
This happens with some compilers on some architectures, which don't define size_t as unsigned int. MicroPython's printf() dooesn't support obscure format specifiers for size_t, so the obvious choice is to explicitly cast to unsigned, to match %u used in printf().
1 parent c38ea32 commit 6832cbd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/utils/pyexec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
120120
{
121121
size_t n_pool, n_qstr, n_str_data_bytes, n_total_bytes;
122122
qstr_pool_info(&n_pool, &n_qstr, &n_str_data_bytes, &n_total_bytes);
123-
printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n", n_pool, n_qstr, n_str_data_bytes, n_total_bytes);
123+
printf("qstr:\n n_pool=" UINT_FMT "\n n_qstr=" UINT_FMT "\n "
124+
"n_str_data_bytes=" UINT_FMT "\n n_total_bytes=" UINT_FMT "\n",
125+
(unsigned)n_pool, (unsigned)n_qstr, (unsigned)n_str_data_bytes, (unsigned)n_total_bytes);
124126
}
125127

126128
#if MICROPY_ENABLE_GC

0 commit comments

Comments
 (0)