diff options
Diffstat (limited to 'Tools/qt/patches')
3 files changed, 178 insertions, 0 deletions
diff --git a/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch b/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch new file mode 100644 index 000000000..053bfee02 --- /dev/null +++ b/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch @@ -0,0 +1,86 @@ +From 63a512023e861380f4489b103212769b741a93dc Mon Sep 17 00:00:00 2001 +From: Thiago Macieira <thiago.macieira@intel.com> +Date: Thu, 30 Oct 2014 20:44:43 -0700 +Subject: [PATCH 1/1] Add macros for enabling/disabling warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows us to avoid the ugly #if for compiler versions. We might +still need for when a warning only occurs in one compiler version, but +otherwise the code will be much cleaner. + +Change-Id: Ibc941d898b3dad2e3d87c11378f29139c31f0fff +Reviewed-by: Olivier Goffart <ogoffart@woboq.com> +Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> +--- + src/corelib/global/qcompilerdetection.h | 46 ++++++++++++++++++++++++++++++++- + 1 file changed, 45 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h +index ee396409d8..dcd185742a 100644 +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1,7 +1,7 @@ + /**************************************************************************** + ** + ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +-** Copyright (C) 2012 Intel Corporation ++** Copyright (C) 2014 Intel Corporation + ** Contact: http://www.qt-project.org/legal + ** + ** This file is part of the QtCore module of the Qt Toolkit. +@@ -1060,6 +1060,50 @@ + # define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION + #endif + ++/* ++ * Warning/diagnostic handling ++ */ ++ ++#define QT_DO_PRAGMA(text) _Pragma(#text) ++#if defined(Q_CC_INTEL) ++# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push)) ++# define QT_WARNING_POP QT_DO_PRAGMA(warning(pop)) ++# define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable: number)) ++# define QT_WARNING_DISABLE_MSVC(number) ++# define QT_WARNING_DISABLE_CLANG(text) ++# define QT_WARNING_DISABLE_GCC(text) ++#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 ++# undef QT_DO_PRAGMA /* not needed */ ++# define QT_WARNING_PUSH __pragma(warning(push)) ++# define QT_WARNING_POP __pragma(warning(pop)) ++# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number)) ++# define QT_WARNING_DISABLE_INTEL(number) ++# define QT_WARNING_DISABLE_CLANG(text) ++# define QT_WARNING_DISABLE_GCC(text) ++#elif defined(Q_CC_CLANG) ++# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push) ++# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop) ++# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text) ++# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too ++# define QT_WARNING_DISABLE_INTEL(number) ++# define QT_WARNING_DISABLE_MSVC(number) ++#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405) ++# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push) ++# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop) ++# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) ++# define QT_WARNING_DISABLE_CLANG(text) ++# define QT_WARNING_DISABLE_INTEL(number) ++# define QT_WARNING_DISABLE_MSVC(number) ++#else // All other compilers, GCC < 4.6 and MSVC < 2008 ++# define QT_WARNING_DISABLE_GCC(text) ++# define QT_WARNING_PUSH ++# define QT_WARNING_POP ++# define QT_WARNING_DISABLE_INTEL(number) ++# define QT_WARNING_DISABLE_MSVC(number) ++# define QT_WARNING_DISABLE_CLANG(text) ++# define QT_WARNING_DISABLE_GCC(text) ++#endif ++ + /* + Proper for-scoping in MIPSpro CC + */ +-- +2.11.0 + diff --git a/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch b/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch new file mode 100644 index 000000000..63258bbcd --- /dev/null +++ b/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch @@ -0,0 +1,62 @@ +From 3092bd56c394f22e027be59368789546afb5ca98 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira <thiago.macieira@intel.com> +Date: Wed, 17 Dec 2014 18:59:17 -0800 +Subject: [PATCH 1/1] Fix Clang warning about inconsistent use of C++11 + override +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We cannot use override in the Q_OBJECT macro, so tell Clang not to warn +about our lack of use of the keyword in the three virtuals that Q_OBJECT +overrides when the user uses Q_DECL_OVERRIDE in their own functions. + +We can't use Q_DECL_OVERRIDE for two reasons: + 1) because that would trigger the warning in any and all virtual + overrides the user may have in their own class (and most of Qt) + 2) because when Q_OBJECT is used in QObject, it's not overriding + anything -- it's the base declaration + +For #2, we could add a different macro exclusively for QObject that moc +would expand, but it's unnecessary work. + +Change-Id: Ic9cb7896f93f06f4e86b6a42dc08f96d257f7550 +Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> +Reviewed-by: Olivier Goffart <ogoffart@woboq.com> +--- + src/corelib/kernel/qobjectdefs.h | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h +index a495bce7ec..84e7a65a54 100644 +--- a/src/corelib/kernel/qobjectdefs.h ++++ b/src/corelib/kernel/qobjectdefs.h +@@ -138,15 +138,24 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {} + # define Q_DECL_HIDDEN_STATIC_METACALL Q_DECL_HIDDEN + #endif + ++#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 306 ++# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override") ++#else ++# define Q_OBJECT_NO_OVERRIDE_WARNING ++#endif ++ + /* qmake ignore Q_OBJECT */ + #define Q_OBJECT \ + public: \ + Q_OBJECT_CHECK \ ++ QT_WARNING_PUSH \ ++ Q_OBJECT_NO_OVERRIDE_WARNING \ + static const QMetaObject staticMetaObject; \ + virtual const QMetaObject *metaObject() const; \ + virtual void *qt_metacast(const char *); \ +- QT_TR_FUNCTIONS \ + virtual int qt_metacall(QMetaObject::Call, int, void **); \ ++ QT_WARNING_POP \ ++ QT_TR_FUNCTIONS \ + private: \ + Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \ + struct QPrivateSignal {}; +-- +2.11.0 + diff --git a/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch b/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch new file mode 100644 index 000000000..f56cd3842 --- /dev/null +++ b/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch @@ -0,0 +1,30 @@ +From 4790ccfa7a7dcdaf5b1c3c3f71bd333a6d754fba Mon Sep 17 00:00:00 2001 +From: David Faure <david.faure@kdab.com> +Date: Wed, 27 Jul 2016 22:57:51 +0200 +Subject: [PATCH 1/1] Fix gcc -Wsuggest-override warning on Q_OBJECT + +Same reasoning as commit 3092bd5 (which was for Clang), but for gcc >= 5.1. + +Change-Id: I123b17670c1a64876b01fd39fb11648fa4e8b1fd +Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> +Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> +--- + src/corelib/kernel/qobjectdefs.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h +index 8d32795af2..0a4492dcda 100644 +--- a/src/corelib/kernel/qobjectdefs.h ++++ b/src/corelib/kernel/qobjectdefs.h +@@ -173,6 +173,8 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {} + + #if defined(Q_CC_CLANG) && Q_CC_CLANG >= 306 + # define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override") ++#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 510 ++# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_GCC("-Wsuggest-override") + #else + # define Q_OBJECT_NO_OVERRIDE_WARNING + #endif +-- +2.11.0 + |