summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-04 11:00:07 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-09 22:39:52 +0200
commit22891dd897b37be03222ec4881629628fb312442 (patch)
treeaa9d95f15e9e3f782d7b248f0175121b94b39e8b /src
parent780137d585344bf9de906a285a50498104c0c66e (diff)
Explain an usage of volatile
It's to work around QTBUG-45307. Change-Id: Ib6076223013e5b1ccfa6ec25e2d040daaa2f19dd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 6476b7404a..ebacd8a0c6 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -728,6 +728,11 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
#ifndef QT_BUILD_QMAKE_BOOTSTRAP
if (!fromConf) {
+ // "volatile" here is a hack to prevent compilers from doing a
+ // compile-time strlen() on "path". The issue is that Qt installers
+ // will binary-patch the Qt installation paths -- in such scenarios, Qt
+ // will be built with a dummy path, thus the compile-time result of
+ // strlen is meaningless.
const char * volatile path = 0;
if (loc == PrefixPath) {
path = getPrefix(