From 30fc4e21604c48b81417e7e387f69f5d65b59980 Mon Sep 17 00:00:00 2001 From: Johannes Schmidt Date: Thu, 26 Feb 2026 11:02:42 +0100 Subject: [PATCH] Silence -Wmaybe-uninitialized on older compilers This is currently a false positive on the debian:11 target and my assumption is that the older GCC can't prove that when `ProcessWaitPID()` returns early, `WIFSIGNALED(status)` is never used. However leaving the variables uninitialized like that is bad anyway, since this might easily be missed when slightly refactoring the function or if/else blocks and then lead to undefined behavior. So now they just get initialized to zero. --- lib/base/process.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index e2b8922c8..89ca8d40b 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -1122,7 +1122,8 @@ bool Process::DoEvents() Log(LogNotice, "Process") << "PID " << m_PID << " (" << PrettyPrintArguments(m_Arguments) << ") terminated with exit code " << exitcode; #else /* _WIN32 */ - int status, exitcode; + int status = 0; + int exitcode = 0; if (could_not_kill || m_PID == -1) { exitcode = 128; } else if (ProcessWaitPID(m_Process, &status) != m_Process) {