summaryrefslogtreecommitdiffstats
path: root/tools/configure
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2010-11-24 07:00:20 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-11-24 07:00:20 (GMT)
commitfe8276e812c5fdc690715d7e36a6b6d70cba7d33 (patch)
treef899ea57702fdb78e2a57d4107d84651c65a3957 /tools/configure
parentd0f74ae9712b2225c12c95891357c5f93c30996c (diff)
downloadQt-fe8276e812c5fdc690715d7e36a6b6d70cba7d33.zip
Qt-fe8276e812c5fdc690715d7e36a6b6d70cba7d33.tar.gz
Qt-fe8276e812c5fdc690715d7e36a6b6d70cba7d33.tar.bz2
Prevent compilers optimizing eval timebomb code out of existence.
The variable that holds the eval license key is a placeholder that is patched during package installation. Unfortunately, for a non-final package build, the placeholder is filled with nulls at compile-time and a clever compiler will optimize away most of the eval timebomb code due to a check in the eval code for the first character of the license key being null. This commit makes the variable that holds the license key volatile, to convince compilers that they cannot make assumptions about the contents of the variable when optimizing. Task-number: QT-3848 Acked-by: Thiago Macieira
Diffstat (limited to 'tools/configure')
-rw-r--r--tools/configure/configureapp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 3808c4e..5966fd2 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3331,7 +3331,7 @@ void Configure::generateConfigfiles()
if (tmpFile3.open()) {
tmpStream.setDevice(&tmpFile3);
tmpStream << "/* Evaluation license key */" << endl
- << "static const char qt_eval_key_data [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
+ << "static const volatile char qt_eval_key_data [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
tmpStream.flush();
tmpFile3.flush();