From 1b93bdca241d1226eda4175abe44124194e11e23 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@nokia.com>
Date: Wed, 17 Aug 2011 09:23:20 +0200
Subject: [PATCH] Disable gcc warning about always-true Q_ASSERT check

gcc 4.5.1 warned about the Q_ASSERT in QStringRef::at() being
always false for isCompleteStringLiteral, isCompleteCharLiteral.

Change-Id: Idb20f81f92876eff685166c8deeebd6e151303b1
Reviewed-on: http://codereview.qt.nokia.com/3070
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
---
 src/libs/cplusplus/MatchingText.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/libs/cplusplus/MatchingText.cpp b/src/libs/cplusplus/MatchingText.cpp
index ad87b0c32a0..7be70afa51a 100644
--- a/src/libs/cplusplus/MatchingText.cpp
+++ b/src/libs/cplusplus/MatchingText.cpp
@@ -55,6 +55,15 @@ static bool shouldOverrideChar(QChar ch)
     }
 }
 
+// disable gcc warning:
+//
+//   qstring.h:1175:39: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
+//
+// caused by Q_ASSERT in QStringRef::at()
+#ifdef Q_CC_GNU
+#    pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
+
 static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index)
 {
     const QStringRef text = tk.textRef(index);
-- 
GitLab