From c9815dff46ef65989d7f48ae9921825c9969bf86 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 20 Mar 2022 19:37:57 +0100 Subject: [PATCH] mxqd: Fix uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc shows "warning: ‘status’ may be used uninitialized in this function [-Wmaybe-uninitialized]" on higher optimization levels. The variable will not be unitialized, if the code logic and the kernel process modell and system calls work as expected, but the compiler doesn't know about that. Initialize variable to a dont-care value to silence the compiler. --- mxqd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mxqd.c b/mxqd.c index 4c95c3d9..493b956e 100644 --- a/mxqd.c +++ b/mxqd.c @@ -1169,7 +1169,7 @@ static int is_reaper(pid_t pid) { int reaper_process(struct mxq_server *server,struct mxq_group_list *glist, struct mxq_job *job) { pid_t pid; struct rusage rusage; - int status; + int status = 0; pid_t waited_pid; int waited_status; struct timeval now;