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.
This commit is contained in:
Johannes Schmidt 2026-02-26 11:02:42 +01:00
parent 037fe1b9b2
commit 30fc4e2160

View file

@ -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) {