summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Weimer <bernd.weimer@qt.io>2022-03-21 15:36:08 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-21 16:40:24 +0000
commit309e8d5107c2ab2a4eed9142aac7af862a1c813e (patch)
tree2f0383fbc80560c3e53db41c65993dc707b36edc
parent3946f396055762819b1e3aaf4c766ff6bb9f9b4e (diff)
downloadqtapplicationmanager-309e8d5107c2ab2a4eed9142aac7af862a1c813e.tar.gz
Work around unused result issue in gcc
This fixes compilation errors even for older versions of glibc. Change-Id: I1ee1be6ad311a0ba47d8e83083bf9ad7bb43f4bf Reviewed-by: Robert Griebl <robert.griebl@qt.io> (cherry picked from commit f64114ea2c2c1bce04271ddc16bf331f3d3d79b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/common-lib/crashhandler.cpp5
-rw-r--r--src/common-lib/unixsignalhandler.cpp6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/common-lib/crashhandler.cpp b/src/common-lib/crashhandler.cpp
index 7ce7df5f..2fc0cc15 100644
--- a/src/common-lib/crashhandler.cpp
+++ b/src/common-lib/crashhandler.cpp
@@ -173,8 +173,9 @@ enum LogToDestination { Console = 0, Dlt = 1 };
static void logMsg(LogToDestination logTo, const char *msg, int msgLen = -1)
{
if (logTo == Console) {
- write(STDERR_FILENO, msg, msgLen >= 0 ? size_t(msgLen) : strlen(msg));
- write(STDERR_FILENO, "\n", 1);
+ auto dummy = write(STDERR_FILENO, msg, msgLen >= 0 ? size_t(msgLen) : strlen(msg));
+ dummy = write(STDERR_FILENO, "\n", 1);
+ Q_UNUSED(dummy)
} else if (logTo == Dlt) {
Logging::logToDlt(QtMsgType::QtFatalMsg, QMessageLogContext(), QLatin1String(msg, msgLen));
}
diff --git a/src/common-lib/unixsignalhandler.cpp b/src/common-lib/unixsignalhandler.cpp
index 8777cd4e..2c2a807a 100644
--- a/src/common-lib/unixsignalhandler.cpp
+++ b/src/common-lib/unixsignalhandler.cpp
@@ -134,7 +134,8 @@ bool UnixSignalHandler::install(Type handlerType, const std::initializer_list<in
h.m_handler(sig);
} else {
#if defined(Q_OS_UNIX)
- (void) write(that->m_pipe[1], &sig, sizeof(int));
+ auto dummy = write(that->m_pipe[1], &sig, sizeof(int));
+ Q_UNUSED(dummy)
#elif defined(Q_OS_WIN)
// we're running in a separate thread now
that->m_winLock.lock();
@@ -163,7 +164,8 @@ bool UnixSignalHandler::install(Type handlerType, const std::initializer_list<in
if (handlerType == ForwardedToEventLoopHandler) {
#if defined(Q_OS_UNIX)
if ((m_pipe[0] == -1) && qApp) {
- (void) pipe(m_pipe);
+ auto dummy = pipe(m_pipe);
+ Q_UNUSED(dummy)
auto sn = new QSocketNotifier(m_pipe[0], QSocketNotifier::Read, this);
connect(sn, &QSocketNotifier::activated, qApp, [this]() {