Disable -Warray-bounds in eglib/src/sort.frag.h!insert_list in GCC 4.6.0+.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 7 Jun 2014 15:57:46 +0000 (17:57 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 7 Jun 2014 15:57:46 +0000 (17:57 +0200)
eglib/src/sort.frag.h

index 2cf5a9ba1f3ea84c2b8e90ec014146f649323c9b..8a98c66f644acf06378f9492c0268fe82811b544 100644 (file)
@@ -124,6 +124,14 @@ sweep_up (struct sort_info *si, list_node *list, int upto)
 static inline void
 insert_list (struct sort_info *si, list_node* list, int rank)
 {
+#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;
 
        if (rank > si->n_ranks) {
@@ -149,6 +157,10 @@ insert_list (struct sort_info *si, list_node* list, int rank)
                si->n_ranks = i + 1;
        si->min_rank = i;
        si->ranks [i] = list;
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
+#pragma GCC diagnostic pop
+#endif
 }
 
 #undef stringify2