Skip to content

Commit

Permalink
Disable -Warray-bounds in eglib/src/sort.frag.h!insert_list in GCC 4.…
Browse files Browse the repository at this point in the history
…6.0+.
  • Loading branch information
Alex Rønne Petersen committed Jun 7, 2014
1 parent bf703c4 commit d6aee5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eglib/src/sort.frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit d6aee5a

Please sign in to comment.