From a858ce0039cb63a6a0afdfabab80ad4adc98ce17 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 1 Jul 2016 14:48:06 +0200 Subject: localstorage: disable warning about tautological comparison When building with gcc 6.1.1, there is a warning like this: plugin.cpp:152:126: error: self-comparison always evaluates to true [-Werror=tautological-compare] DEFINE_OBJECT_VTABLE(QV4::QQmlSqlDatabaseWrapper); In the definition of DEFINE_OBJECT_VTABLE, the comparison &classname::SuperClass::static_vtbl == &Object::static_vtbl ? 0 : &classname::SuperClass::static_vtbl.vTable will be done at runtime. Maybe the macro could somehow do that at compile time (or maybe the compiler will optimize it away after detecting that the result is constant); but for now, this warning breaks the build. Task-number: QTBUG-53373 Change-Id: I5f8e429a3f1446d3ef931ff8b0c41fcf652f7a02 Reviewed-by: Thiago Macieira --- src/imports/localstorage/plugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index a043af6b46..fbcb6ddea5 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -149,7 +149,12 @@ public: using namespace QV4; +QT_WARNING_PUSH +#if (Q_CC_GNU >= 600) +QT_WARNING_DISABLE_GCC("-Wtautological-compare") +#endif DEFINE_OBJECT_VTABLE(QV4::QQmlSqlDatabaseWrapper); +QT_WARNING_POP -- cgit v1.2.3