aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4managed_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-10-08 13:03:35 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-10-10 04:41:42 +0000
commit376077a8e73100ccada6f2bb81c6664817bb44ba (patch)
treee7b8aafe38d3a2c9a71f55e30e1b669c38768dbd /src/qml/jsruntime/qv4managed_p.h
parenta292697222dd85e586f26bd7133f3e17e30992c2 (diff)
Fix developer-build with gcc 6
Locally suppress bogus tautological compare warnings. Task-number: QTBUG-56266 Change-Id: Ic1b554982a778cdd89c8047483523c44d53bbadd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/qml/jsruntime/qv4managed_p.h')
-rw-r--r--src/qml/jsruntime/qv4managed_p.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 6a1bd7a9a4..5bda628bf1 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -94,6 +94,18 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
#define Q_VTABLE_FUNCTION(classname, func) \
(classname::func == QV4::Managed::func ? 0 : classname::func)
+// Q_VTABLE_FUNCTION triggers a bogus tautological-compare warning in GCC6+
+#if defined(Q_CC_GNU) && Q_CC_GNU >= 600
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+ QT_WARNING_PUSH; \
+ QT_WARNING_DISABLE_GCC("-Wtautological-compare")
+
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF \
+ ;QT_WARNING_POP
+#else
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON
+#define QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
+#endif
#define DEFINE_MANAGED_VTABLE_INT(classname, parentVTable) \
{ \
@@ -113,7 +125,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
}
#define DEFINE_MANAGED_VTABLE(classname) \
-const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0)
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
+const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0) \
+QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
struct Q_QML_PRIVATE_EXPORT Managed : Value
{