summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-11-01 09:47:14 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-11-16 10:51:35 +0000
commit84ff636ecf90342ccb81a67d526f42731cd07793 (patch)
treede13291e19390529a95fc52f15fa06183c14b268 /src/corelib/global/qlogging.h
parentdc0111b2a75eebf2535df894b66ef8d1a1ba57e0 (diff)
Logging: Explicitly cast Q_FUNC_INFO and __FILE__ to const char *
Otherwise they might end up as const char[], which clang-tidy complains about because it implicitly decays into a pointer when passed to the QMessageLogger ctor. Change-Id: I0d223f0c94cb63be6fc2a165348f143fadaf11ea Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qlogging.h')
-rw-r--r--src/corelib/global/qlogging.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index 16e01183bd..dded09999b 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -153,9 +153,9 @@ private:
#endif
#ifdef QT_MESSAGELOGCONTEXT
- #define QT_MESSAGELOG_FILE __FILE__
+ #define QT_MESSAGELOG_FILE static_cast<const char *>(__FILE__)
#define QT_MESSAGELOG_LINE __LINE__
- #define QT_MESSAGELOG_FUNC Q_FUNC_INFO
+ #define QT_MESSAGELOG_FUNC static_cast<const char *>(Q_FUNC_INFO)
#else
#define QT_MESSAGELOG_FILE nullptr
#define QT_MESSAGELOG_LINE 0