[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace] kcontrol/keyboard: Add a workaround to avoid a crash produced by a GCC bug
From:       Àlex_Fiestas <afiestas () kde ! org>
Date:       2013-11-21 18:04:26
Message-ID: E1VjYc6-0005gf-VG () scm ! kde ! org
[Download RAW message or body]

Git commit 94541ca9eb8941f1635e7f524770ccb0c59ac826 by Àlex Fiestas.
Committed on 21/11/2013 at 17:59.
Pushed by afiestas into branch 'master'.

Add a workaround to avoid a crash produced by a GCC bug

This bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58800
in nth_element makes QtConcurrent::blockingFilter crash since underneath
QtConcurrent uses QtConcurrent::Median which uses nth_element.

We need the workaround so we can continue working on
kde-workspace/frameworks without having kded5 crashing.

CCMAIL: arysin@gmail.com
CCMAIL: mklapetek@kde.org

M  +13   -1    kcontrol/keyboard/xkb_rules.cpp

http://commits.kde.org/kde-workspace/94541ca9eb8941f1635e7f524770ccb0c59ac826

diff --git a/kcontrol/keyboard/xkb_rules.cpp b/kcontrol/keyboard/xkb_rules.cpp
index e8b6324..ef99cac 100644
--- a/kcontrol/keyboard/xkb_rules.cpp
+++ b/kcontrol/keyboard/xkb_rules.cpp
@@ -86,7 +86,19 @@ static bool notEmpty(const ConfigItem* item)
 template<class T>
 void removeEmptyItems(QList<T*>& list)
 {
-  QtConcurrent::blockingFilter(list, notEmpty);
+#ifdef __GNUC__
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ == 2
+#warning Compiling with a workaround for GCC 4.8.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58800
+    Q_FOREACH(T* x, list) {
+        ConfigItem *y = static_cast<ConfigItem*>(x);
+        if (y->name.isEmpty()) {
+            list.removeAll(x);
+        }
+    }
+#else
+    QtConcurrent::blockingFilter(list, notEmpty);
+#endif
+#endif
 }
 
 static
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic