From 69b69a7bccbb153d687b8cf228e3342fa305b93f Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Fri, 19 May 2023 14:48:44 +0200 Subject: [PATCH] Add [[maybe_unused]] to avoid compilation warnings on Android When cross compiling for Android, these need to be marked with [[maybe_unused]] as they might break the build due to Android not having pthread cancellation feature. Pick-to: 6.5 Change-Id: I3b3fb58b5e6df8ce37c2d8d9b1b8e8295f0aebb0 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 7ae28b84dd8..90ee3cb0b44 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -529,7 +529,7 @@ void QProcessPrivate::startProcess() // Disable PThread cancellation from this point on: we mustn't have it // enabled when the child starts running nor while our state could get // corrupted if we abruptly exited this function. - PThreadCancelGuard cancelGuard; + [[maybe_unused]] PThreadCancelGuard cancelGuard; // Start the child. auto execChild1 = [this, workingDirFd, &argv, &envp]() { @@ -1088,7 +1088,7 @@ bool QProcessPrivate::startDetached(qint64 *pid) const CharPointerList envp(environment.d.constData()); // see startProcess() for more information - PThreadCancelGuard cancelGuard; + [[maybe_unused]] PThreadCancelGuard cancelGuard; auto doFork = [this]() { if (useForkFlags(unixExtras.get()))