diff options
| author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-12-16 15:22:17 +0100 |
|---|---|---|
| committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-05-12 15:33:52 +0200 |
| commit | 2550568a92db79b7a313c89a1578e235fc0b27f5 (patch) | |
| tree | 30c7575e045f4dbe17e4c84e3dcf68e7740ff5e8 /src/corelib/global/qlogging.cpp | |
| parent | 417b61b0158def614f4079761f85ccba39fba587 (diff) | |
Enable [[noreturn]] attribute for non-MSVC compilers on Windows
Avoids -Wsometimes-uninitialized warnings with clang-cl.
Also do not allow to return qt_message_fatal() if built with other
compiler than MSVC.
Amends 97b32fa0b661c5dd89d525122427496132abb54a
Fixes: QTBUG-113351
Change-Id: I9ce87057e764af1e25de93388ae983891df66d2e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.cpp')
| -rw-r--r-- | src/corelib/global/qlogging.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index faafc8cff13..a9a3d019c7c 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -163,7 +163,7 @@ Q_TRACE_POINT(qtcore, qt_message_print, int type, const char *category, const ch \snippet code/src_corelib_global_qglobal.cpp 4 */ -#if !defined(Q_CC_MSVC) || defined(Q_CC_CLANG) +#if !defined(Q_CC_MSVC_ONLY) Q_NORETURN #endif static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message); @@ -342,7 +342,7 @@ using namespace QtPrivate; \sa QMessageLogContext, qDebug(), qInfo(), qWarning(), qCritical(), qFatal() */ -#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) +#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) noexcept { size_t len = qstrlen(s); @@ -2023,7 +2023,7 @@ static void qt_message_print(const QString &message) static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message) { -#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) +#if defined(Q_CC_MSVC_ONLY) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR) wchar_t contextFileL[256]; // we probably should let the compiler do this for us, by declaring QMessageLogContext::file to // be const wchar_t * in the first place, but the #ifdefery above is very complex and we |
