Force length fo licensee literals to be computed at runtime

Prevent compilers from computing strlen() at compile time by
passing a volatile pointer.

Task-number: QTBUG-34261
Change-Id: I5e5e80181024d57496907918d2a43d7c83841082
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Kai Koehne 2013-10-28 12:48:15 +01:00 committed by The Qt Project
parent 6adfca1acb
commit 6381c807e5

View File

@ -221,7 +221,7 @@ QLibraryInfo::QLibraryInfo()
QString QString
QLibraryInfo::licensee() QLibraryInfo::licensee()
{ {
const char *str = QT_CONFIGURE_LICENSEE; const char * volatile str = QT_CONFIGURE_LICENSEE;
return QString::fromLocal8Bit(str); return QString::fromLocal8Bit(str);
} }
@ -234,7 +234,7 @@ QLibraryInfo::licensee()
QString QString
QLibraryInfo::licensedProducts() QLibraryInfo::licensedProducts()
{ {
const char *str = QT_CONFIGURE_LICENSED_PRODUCTS; const char * volatile str = QT_CONFIGURE_LICENSED_PRODUCTS;
return QString::fromLatin1(str); return QString::fromLatin1(str);
} }