summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-11-17 15:49:25 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-11-19 13:10:29 +0100
commit635774fc324f079a41e2cecbcfdb700bf171ab6c (patch)
treeb4ff3032679952b49e679583b25c06c6e069c7aa /src/corelib/io/qprocess_unix.cpp
parente6d85cf28bc4f750b69c33b72c006b067ae1190f (diff)
QProcess: work around GCC 13 -Wmaybe-uninitialized in -unity-build
When in a unity-build GCC 13 sees the implementation of forkfd_wait4(), called dfrom forkfd_wait(), it can prove that there are paths that do not initialize *info: Those paths are the returns following fcntl() in system_forkfs_wait() in forkd_linux.c and read() in forkfd_wait4(). To work around the issue and unbreak unity-builds, initialize info = {}. Task-number: QTBUG-119081 Pick-to: 6.6 6.5 Change-Id: I1b3504e7f83c766ebccc851233d4c3e677bf2acd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 361b28dcff..69c2ec73cc 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -1253,7 +1253,8 @@ void QProcessPrivate::waitForDeadChild()
Q_ASSERT(forkfd != -1);
// read the process information from our fd
- forkfd_info info;
+ forkfd_info info = {}; // Silence -Wmaybe-uninitialized; Thiago says forkfd_wait cannot fail here
+ // (QTBUG-119081)
int ret;
EINTR_LOOP(ret, forkfd_wait(forkfd, &info, nullptr));