From f1d521f0765c6bb928f3fe39f952366f956fa241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Thu, 17 Feb 2022 18:16:32 +0200 Subject: [PATCH] QNX: Silence compiler warning by initializing variable qtbase/src/corelib/global/qlogging.cpp: In function 'void qDefaultMessageHandler(QtMsgType, const QMessageLogContext&, const QString&)': qtbase/src/corelib/global/qlogging.cpp:1555:11: warning: 'severity' may be used uninitialized in this function [-Wmaybe-uninitialized] slog2c(NULL, QT_LOG_CODE, severity, formattedMessage.toLocal8Bit().constData()); qtbase/src/corelib/global/qlogging.cpp:1535:9: note: 'severity' was declared here int severity; Pick-to: 6.2 6.3 5.15 Change-Id: Ic0d41a024056528cac51a88086ac7e492c94bb4a Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 7c37d5b4329..a50eccfa7f7 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1532,7 +1532,7 @@ static bool slog2_default_handler(QtMsgType type, const QMessageLogContext &cont // Set as the default buffer slog2_set_default_buffer(buffer_handle); } - int severity; + int severity = SLOG2_INFO; //Determines the severity level switch (type) { case QtDebugMsg: