mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
py: Fix passing of some wide int types to printf varg format list.
Passing an mp_uint_t to a %d printf format is incorrect for builds where mp_uint_t is larger than word size (eg a nanboxing build). This patch adds some simple casting to int in these cases.
This commit is contained in:
@@ -788,7 +788,7 @@ too_short:
|
||||
"wrong number of values to unpack"));
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||
"need more than %d values to unpack", seq_len));
|
||||
"need more than %d values to unpack", (int)seq_len));
|
||||
}
|
||||
too_long:
|
||||
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
|
||||
@@ -796,7 +796,7 @@ too_long:
|
||||
"wrong number of values to unpack"));
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||
"too many values to unpack (expected %d)", num));
|
||||
"too many values to unpack (expected %d)", (int)num));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -863,7 +863,7 @@ too_short:
|
||||
"wrong number of values to unpack"));
|
||||
} else {
|
||||
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError,
|
||||
"need more than %d values to unpack", seq_len));
|
||||
"need more than %d values to unpack", (int)seq_len));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user