diff options
author | Bernd Weimer <bernd.weimer@qt.io> | 2022-03-21 15:36:08 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-03-21 16:40:24 +0000 |
commit | 8d10980a202509c411fce2720e19a8c4e71fcf8f (patch) | |
tree | 70a79066ef599857e8014c8ce372c99dce2f8fb8 | |
parent | 2626ae6e9ce84aebd88a163153719c07d7f65b7d (diff) | |
download | qtapplicationmanager-8d10980a202509c411fce2720e19a8c4e71fcf8f.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.cpp | 5 | ||||
-rw-r--r-- | src/common-lib/unixsignalhandler.cpp | 6 |
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]() { |