From 9b1056ef0eca8457e4fe374d722fe7a37fadbafe Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Fri, 19 Jun 2020 13:24:30 +0200 Subject: [PATCH] fuzz: Fix compile error in simulated glibc rand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using LWIP_RAND_FOR_FUZZ_SIMULATE_GLIBC: fuzz_common.c: In function ‘lwip_fuzz_rand’: fuzz_common.c:683:11: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] 683 | if (idx >= sizeof(rand_nrs)/sizeof((rand_nrs)[0])) { | ^~ cc1: all warnings being treated as errors --- test/fuzz/fuzz_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fuzz/fuzz_common.c b/test/fuzz/fuzz_common.c index 93c09188..da4b8222 100644 --- a/test/fuzz/fuzz_common.c +++ b/test/fuzz/fuzz_common.c @@ -677,7 +677,7 @@ u32_t lwip_fuzz_rand(void) 0x19495cff, 0x2ae8944a, 0x625558ec, 0x238e1f29, 0x46e87ccd, 0x3d1b58ba, 0x507ed7ab, 0x2eb141f2, 0x41b71efb, 0x79e2a9e3, 0x7545e146, 0x515f007c, 0x5bd062c2, 0x12200854, 0x4db127f8}; - static int idx = 0; + static unsigned idx = 0; u32_t ret = rand_nrs[idx]; idx++; if (idx >= sizeof(rand_nrs)/sizeof((rand_nrs)[0])) {