Skip to content

Commit 8ce21cd

Browse files
committed
Fix compiler warnings in mmtk.c
gc/mmtk/mmtk.c:505:1: warning: function 'rb_mmtk_gc_thread_panic_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn] 505 | { | ^ gc/mmtk/mmtk.c:987:27: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant] 987 | char obj_info_buf[info_size]; | ^~~~~~~~~ gc/mmtk/mmtk.c:990:34: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant] 990 | char parent_obj_info_buf[info_size]; | ^~~~~~~~~
1 parent b0261a8 commit 8ce21cd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

gc/mmtk/mmtk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ rb_mmtk_gc_thread_bug(const char *msg, ...)
500500
rb_bug("rb_mmtk_gc_thread_bug");
501501
}
502502

503+
RBIMPL_ATTR_NORETURN()
503504
static void
504505
rb_mmtk_gc_thread_panic_handler(void)
505506
{
@@ -983,7 +984,7 @@ static inline VALUE
983984
rb_mmtk_call_object_closure(VALUE obj, bool pin)
984985
{
985986
if (RB_UNLIKELY(RB_BUILTIN_TYPE(obj) == T_NONE)) {
986-
const size_t info_size = 256;
987+
enum { info_size = 256 };
987988
char obj_info_buf[info_size];
988989
rb_raw_obj_info(obj_info_buf, info_size, obj);
989990

0 commit comments

Comments
 (0)