Silence another array subscript warning in eglib/src/sort.frag.h.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 7 Jun 2014 20:26:58 +0000 (22:26 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 7 Jun 2014 20:27:22 +0000 (22:27 +0200)
eglib/src/sort.frag.h

index 8a98c66f644acf06378f9492c0268fe82811b544..6dc1950ae4e9a9b87358266497993a7a8306fdfa 100644 (file)
@@ -88,12 +88,24 @@ merge_lists (list_node *first, list_node *second, GCompareFunc func)
 static inline list_node *
 sweep_up (struct sort_info *si, list_node *list, int upto)
 {
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+       /*
+        * GCC incorrectly thinks we're writing below si->ranks array bounds.
+        */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+
        int i;
        for (i = si->min_rank; i < upto; ++i) {
                list = merge_lists (si->ranks [i], list, si->func);
                si->ranks [i] = NULL;
        }
        return list;
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+#pragma GCC diagnostic pop
+#endif
 }
 
 /*