From 2e5fd79e375d8a9f306886aa9279b3c3cef11a3c Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Wed, 6 Nov 2024 15:59:32 -0800 Subject: [PATCH] Fixed building by Clang. src/qjs.c:347:19: error: variable 'signo' may be uninitialized when used here [-Werror,-Wconditional-uninitialized] 347 | if (kill(pid, signo) < 0) { | ^~~~~ src/qjs.c:294:31: note: initialize the variable 'signo' to silence this warning 294 | int signo, pid; | ^ | = 0 1 error generated. --- src/qjs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qjs.c b/src/qjs.c index 44e9fe95a..f9615668f 100644 --- a/src/qjs.c +++ b/src/qjs.c @@ -301,6 +301,8 @@ qjs_process_kill(JSContext *ctx, JSValueConst this_val, int argc, return JS_EXCEPTION; } + signo = SIGTERM; + if (JS_IsNumber(argv[1])) { if (JS_ToInt32(ctx, &signo, argv[1]) < 0) { return JS_EXCEPTION;