From afee50e89e7403cd6091a5082aeb141cc902b63a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Sat, 11 Nov 2023 15:37:23 +0100 Subject: [PATCH] Fix compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ~~~ /home/runner/work/quickjs/quickjs/qjs.c:506:28: error: ‘best[3]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 506 | if (i == 0 || best[j] > ms) | ~~~~~~~^~~~~~~~~~~~~~~ /home/runner/work/quickjs/quickjs/qjs.c:506:28: error: ‘best[2]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] /home/runner/work/quickjs/quickjs/qjs.c:506:28: error: ‘best[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ~~~ --- qjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qjs.c b/qjs.c index 66ff4c6..37f08db 100644 --- a/qjs.c +++ b/qjs.c @@ -489,7 +489,7 @@ int main(int argc, char **argv) if (empty_run && dump_memory) { clock_t t[5]; - double best[5]; + double best[5] = {0}; int i, j; for (i = 0; i < 100; i++) { t[0] = clock();