From f9b3b02360f5b2352cfe26494fb07c7f2f3b7832 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@digia.com>
Date: Mon, 22 Apr 2013 11:56:45 +0200
Subject: [PATCH] Fix compiler warning about deprecated API

Explicitly disable warnings about qInstallMsgHandler being deprecated.
We have to use it in testlib to not break test cases still using it.

Change-Id: Icf7eb6c4d549f80ef45a4201fab2ac3eb03dda9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/testlib/qtestlog.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index 7a4f369ed30..99c7ec749db 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -399,6 +399,12 @@ void QTestLog::addBenchmarkResult(const QBenchmarkResult &result)
     QTest::TestLoggers::addBenchmarkResult(result);
 }
 
+// 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
+
 void QTestLog::startLogging()
 {
     QTest::TestLoggers::startLogging();
@@ -414,6 +420,10 @@ void QTestLog::stopLogging()
     saveCoverageTool(QTestResult::currentAppname(), failCount() != 0, QTestLog::installedTestCoverage());
 }
 
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
+# pragma GCC diagnostic pop
+#endif
+
 void QTestLog::addLogger(LogMode mode, const char *filename)
 {
     if (filename && strcmp(filename, "-") == 0)
-- 
GitLab