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
commitea2b28dbffdb62bb76eeab3ff9f6ac205f20f39e (patch)
treeeaabbbbc06e2f20e8a032c6b38878686e03840b3
parent59d78be1056a3ba9db7f05bed71a7b7f48ee6405 (diff)
downloadqtapplicationmanager-ea2b28dbffdb62bb76eeab3ff9f6ac205f20f39e.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 276f194b..d67482dd 100644
--- a/src/common-lib/crashhandler.cpp
+++ b/src/common-lib/crashhandler.cpp
@@ -181,8 +181,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 802e0db8..02b03551 100644
--- a/src/common-lib/unixsignalhandler.cpp
+++ b/src/common-lib/unixsignalhandler.cpp
@@ -145,7 +145,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();
@@ -178,7 +179,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]() {