From dc4d119d3d96799bf848c6488b2ac49b933ab7cb Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 31 Mar 2020 14:19:52 +0200 Subject: [PATCH] py/objarray: Fix sign mismatch in comparison. Found when compiling with clang and -Wsign-compare. --- py/objarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objarray.c b/py/objarray.c index 20232040ed..4947f75905 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -445,7 +445,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value } #endif if (len_adj > 0) { - if (len_adj > o->free) { + if ((size_t)len_adj > o->free) { // TODO: alloc policy; at the moment we go conservative o->items = m_renew(byte, o->items, (o->len + o->free) * item_sz, (o->len + len_adj) * item_sz); o->free = len_adj;