Skip to content

Commit

Permalink
qmake: Work around MSVC compiler bug.
Browse files Browse the repository at this point in the history
Disable optimization for getProjectUUID() as it triggers
ASSERT: "&other != this" at qstring.h:720 with -O2.

Change-Id: I51b31d4318ba9be187c186623099171d8f48235b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
Friedemann Kleint authored and Qt by Nokia committed Feb 5, 2012
1 parent 60f24ec commit 9f54846
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions qmake/generators/win32/msvc_vcproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@ struct VcsolutionDepend {
QStringList dependencies;
};

/* Disable optimization in getProjectUUID() due to a compiler
* bug in MSVC 2010 that causes ASSERT: "&other != this" in the QString
* copy constructor for non-empty file names at:
* filename.isEmpty()?project->first("QMAKE_MAKEFILE"):filename */

#ifdef Q_CC_MSVC
# pragma optimize( "g", off )
# pragma warning ( disable : 4748 )
#endif

QUuid VcprojGenerator::getProjectUUID(const QString &filename)
{
bool validUUID = true;
Expand Down Expand Up @@ -335,6 +345,10 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename)
return uuid;
}

#ifdef Q_CC_MSVC
# pragma optimize( "g", on )
#endif

QUuid VcprojGenerator::increaseUUID(const QUuid &id)
{
QUuid result(id);
Expand Down

0 comments on commit 9f54846

Please sign in to comment.