diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-04-18 11:15:36 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-04-18 11:17:04 (GMT) |
commit | 8856e2412fc2756443288644465d9edce5798fea (patch) | |
tree | 511fa48c409e90e47f36f79281f0e3df7bf178a3 /src/declarative | |
parent | 9b97e319fc2a8e48a454725a5eb54edeb305a27c (diff) | |
download | Qt-8856e2412fc2756443288644465d9edce5798fea.zip Qt-8856e2412fc2756443288644465d9edce5798fea.tar.gz Qt-8856e2412fc2756443288644465d9edce5798fea.tar.bz2 |
Alternative fix to the strict-aliasing violation warnings
The code doesn't actually violate aliasing by doing type-punned
dereferencing. The objects are always accessed as the right type. So
disable the warning and pray that GCC doesn't optimise code out of
existence.
Reviewed-by: Trust Me
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativeobjectscriptclass.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index dc3ecca..9eecc65 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -54,7 +54,15 @@ #include <QtCore/qvarlengtharray.h> #include <QtScript/qscriptcontextinfo.h> -Q_DECLARE_METATYPE(QScriptValue); +Q_DECLARE_METATYPE(QScriptValue) + +#if defined(__GNUC__) +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +// The code in this file does not violate strict aliasing, but GCC thinks it does +// so turn off the warnings for us to have a clean build +# pragma GCC diagnostic ignored "-Wstrict-aliasing" +# endif +#endif QT_BEGIN_NAMESPACE |