summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2012-10-24 12:25:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-01 09:06:15 +0100
commite27a58864366b65803bcd43e0b8994169d3d291a (patch)
treefd7dfda3f35710e061d471bb8653fe49fdd142ca
parenta5e95ce39ebb84a5cd21258ceb1b64c544fc6d47 (diff)
Testlib: Disable gcc warning about deprecated qInstallMsgHandler
Fix warning: 'void (* qInstallMsgHandler(QtMsgHandler))(QtMsgType, const char*)' is deprecated (declared at qtestlog.cpp:85) [-Wdeprecated-declarations] Change-Id: I28d2baf696fdeddec90780edc88574fc368468db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
-rw-r--r--src/testlib/qtestlog.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index c56a00237b..a337a81959 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -238,6 +238,12 @@ namespace QTest {
return false;
}
+// don't warn about qInstallMsgHandler
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
static void messageHandler(QtMsgType type, const char *msg)
{
static QBasicAtomicInt counter = Q_BASIC_ATOMIC_INITIALIZER(QTest::maxWarnings);
@@ -287,6 +293,10 @@ namespace QTest {
break;
}
}
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
+# pragma GCC diagnostic pop
+#endif
}
void QTestLog::enterTestFunction(const char* function)