Skip to content

Commit

Permalink
Suppress array-bounds warnings from gcc 13
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Nov 7, 2023
1 parent f2d6b41 commit 8becc88
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/array.h
Expand Up @@ -136,9 +136,16 @@ RBIMPL_ATTR_ARTIFICIAL()
static inline VALUE
RARRAY_AREF(VALUE ary, long i)
{
VALUE val;
RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY);

return RARRAY_CONST_PTR(ary)[i];
RBIMPL_WARNING_PUSH();
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ == 13
RBIMPL_WARNING_IGNORED(-Warray-bounds);
#endif
val = RARRAY_CONST_PTR(ary)[i];
RBIMPL_WARNING_POP();
return val;
}

#endif /* INTERNAL_ARRAY_H */

0 comments on commit 8becc88

Please sign in to comment.