Index: variable.c =================================================================== --- variable.c (revision 34818) +++ variable.c (working copy) @@ -690,7 +690,8 @@ trace_ev(struct trace_data *data) (*trace->func)(trace->data, data->val); trace = trace->next; } - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE @@ -1351,7 +1352,8 @@ rb_obj_remove_instance_variable(VALUE ob break; } rb_name_error(id, "instance variable %s not defined", rb_id2name(id)); - return Qnil; /* not reached */ + + UNREACHABLE; } NORETURN(static void uninitialized_constant(VALUE, ID)); @@ -1415,7 +1417,8 @@ rb_mod_const_missing(VALUE klass, VALUE { rb_frame_pop(); /* pop frame for "const_missing" */ uninitialized_constant(klass, rb_to_id(name)); - return Qnil; /* not reached */ + + UNREACHABLE; } static void @@ -2390,7 +2393,8 @@ rb_mod_remove_cvar(VALUE mod, VALUE name } rb_name_error(id, "class variable %s not defined for %s", rb_id2name(id), rb_class2name(mod)); - return Qnil; /* not reached */ + + UNREACHABLE; } VALUE Index: enum.c =================================================================== --- enum.c (revision 34818) +++ enum.c (working copy) @@ -709,7 +709,8 @@ first_i(VALUE i, VALUE params, int argc, memo->u1.value = i; rb_iter_break(); - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE Index: string.c =================================================================== --- string.c (revision 34818) +++ string.c (working copy) @@ -3175,7 +3175,8 @@ rb_str_aref(VALUE str, VALUE indx) idx = NUM2LONG(indx); goto num_index; } - return Qnil; /* not reached */ + + UNREACHABLE; } @@ -4088,7 +4089,8 @@ str_byte_aref(VALUE str, VALUE indx) idx = NUM2LONG(indx); goto num_index; } - return Qnil; /* not reached */ + + UNREACHABLE; } /* @@ -7734,7 +7736,8 @@ rb_to_id(VALUE name) case T_SYMBOL: return SYM2ID(name); } - return Qnil; /* not reached */ + + UNREACHABLE; } /* Index: io.c =================================================================== --- io.c (revision 34818) +++ io.c (working copy) @@ -4395,7 +4395,8 @@ rb_io_fmode_modestr(int fmode) return MODE_BTMODE("r+", "rb+", "rt+"); } rb_raise(rb_eArgError, "invalid access fmode 0x%x", fmode); - return NULL; /* not reached */ + + UNREACHABLE; } static int @@ -4561,7 +4562,8 @@ rb_io_oflags_modestr(int oflags) return MODE_BINARY("r+", "rb+"); } rb_raise(rb_eArgError, "invalid access oflags 0x%x", oflags); - return NULL; /* not reached */ + + UNREACHABLE; } /* Index: pack.c =================================================================== --- pack.c (revision 34818) +++ pack.c (working copy) @@ -247,7 +247,8 @@ num2i32(VALUE x) return rb_big2ulong_pack(x); } rb_raise(rb_eTypeError, "can't convert %s to `integer'", rb_obj_classname(x)); - return 0; /* not reached */ + + UNREACHABLE; } #define MAX_INTEGER_PACK_SIZE 8 Index: vm_eval.c =================================================================== --- vm_eval.c (revision 34818) +++ vm_eval.c (working copy) @@ -497,7 +497,7 @@ rb_method_missing(int argc, const VALUE { rb_thread_t *th = GET_THREAD(); raise_method_missing(th, argc, argv, obj, th->method_missing_reason); - return Qnil; /* not reached */ + UNREACHABLE; } #define NOEX_MISSING 0x80 @@ -1462,7 +1462,7 @@ rb_f_throw(int argc, VALUE *argv) rb_scan_args(argc, argv, "11", &tag, &value); rb_throw_obj(tag, value); - return Qnil; /* not reached */ + UNREACHABLE; } void Index: dir.c =================================================================== --- dir.c (revision 34818) +++ dir.c (working copy) @@ -590,7 +590,8 @@ dir_read(VALUE dir) else { rb_sys_fail(0); } - return Qnil; /* not reached */ + + UNREACHABLE; } /* Index: win32/win32.c =================================================================== --- win32/win32.c (revision 34818) +++ win32/win32.c (working copy) @@ -1074,8 +1074,8 @@ child_result(struct ChildRecord *child, GetExitCodeProcess(child->hProcess, &exitcode); CloseChildHandle(child); _exit(exitcode); - default: - return -1; /* not reached */ + default + UNREACHABLE; } } Index: struct.c =================================================================== --- struct.c (revision 34818) +++ struct.c (working copy) @@ -113,7 +113,8 @@ rb_struct_getmember(VALUE obj, ID id) } } rb_name_error(id, "%s is not struct member", rb_id2name(id)); - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE @@ -175,7 +176,8 @@ rb_struct_set(VALUE obj, VALUE val) } rb_name_error(rb_frame_this_func(), "`%s' is not a struct member", rb_id2name(rb_frame_this_func())); - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE @@ -617,7 +619,8 @@ rb_struct_aref_id(VALUE s, ID id) } } rb_name_error(id, "no member '%s' in struct", rb_id2name(id)); - return Qnil; /* not reached */ + + UNREACHABLE; } /* Index: eval.c =================================================================== --- eval.c (revision 34818) +++ eval.c (working copy) @@ -516,7 +516,8 @@ rb_f_raise(int argc, VALUE *argv) } } rb_raise_jump(rb_make_exception(argc, argv)); - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE Index: process.c =================================================================== --- process.c (revision 34818) +++ process.c (working copy) @@ -2843,7 +2843,7 @@ rb_f_exit_bang(int argc, VALUE *argv, VA } _exit(istatus); - return Qnil; /* not reached */ + UNREACHABLE; } void @@ -2916,7 +2916,8 @@ rb_f_exit(int argc, VALUE *argv) istatus = EXIT_SUCCESS; } rb_exit(istatus); - return Qnil; /* not reached */ + + UNREACHABLE; } @@ -2950,7 +2951,8 @@ rb_f_abort(int argc, VALUE *argv) args[0] = INT2NUM(EXIT_FAILURE); rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit)); } - return Qnil; /* not reached */ + + UNREACHABLE; } void Index: ext/-test-/iter/break.c =================================================================== --- ext/-test-/iter/break.c (revision 34818) +++ ext/-test-/iter/break.c (working copy) @@ -4,7 +4,8 @@ static VALUE iter_break_value(VALUE self, VALUE val) { rb_iter_break_value(val); - return self; /* not reached */ + + UNREACHABLE; } void Index: ext/pty/pty.c =================================================================== --- ext/pty/pty.c (revision 34818) +++ ext/pty/pty.c (working copy) @@ -687,7 +687,8 @@ pty_check(int argc, VALUE *argv, VALUE s if (!RTEST(exc)) return rb_last_status_get(); raise_from_check(cpid, status); - return Qnil; /* not reached */ + + UNREACHABLE; } static VALUE cPTY; Index: ext/openssl/ossl_pkey.c =================================================================== --- ext/openssl/ossl_pkey.c (revision 34818) +++ ext/openssl/ossl_pkey.c (working copy) @@ -98,7 +98,8 @@ ossl_pkey_new(EVP_PKEY *pkey) default: ossl_raise(ePKeyError, "unsupported key type"); } - return Qnil; /* not reached */ + + UNREACHABLE; } VALUE Index: ext/readline/readline.c =================================================================== --- ext/readline/readline.c (revision 34818) +++ ext/readline/readline.c (working copy) @@ -1379,7 +1379,8 @@ rb_remove_history(int index) return Qnil; #else rb_notimplement(); - return Qnil; /* not reached */ + + UNREACHABLE; #endif } Index: ext/stringio/stringio.c =================================================================== --- ext/stringio/stringio.c (revision 34818) +++ ext/stringio/stringio.c (working copy) @@ -287,7 +287,8 @@ strio_unimpl(int argc, VALUE *argv, VALU { StringIO(self); rb_notimplement(); - return Qnil; /* not reached */ + + UNREACHABLE; } /* Index: numeric.c =================================================================== --- numeric.c (revision 34818) +++ numeric.c (working copy) @@ -260,7 +260,8 @@ num_sadded(VALUE x, VALUE name) "can't define singleton method \"%s\" for %s", rb_id2name(mid), rb_obj_classname(x)); - return Qnil; /* not reached */ + + UNREACHABLE; } /* :nodoc: */ @@ -269,7 +270,8 @@ num_init_copy(VALUE x, VALUE y) { /* Numerics are immutable values, which should not be copied */ rb_raise(rb_eTypeError, "can't copy %s", rb_obj_classname(x)); - return Qnil; /* not reached */ + + UNREACHABLE; } /* @@ -2089,17 +2091,19 @@ rb_num2ll(VALUE val) case T_STRING: rb_raise(rb_eTypeError, "no implicit conversion from string"); - return Qnil; /* not reached */ + break; case T_TRUE: case T_FALSE: rb_raise(rb_eTypeError, "no implicit conversion from boolean"); - return Qnil; /* not reached */ + break; default: val = rb_to_int(val); return NUM2LL(val); } + + UNREACHABLE; } unsigned LONG_LONG @@ -2131,17 +2135,19 @@ rb_num2ull(VALUE val) case T_STRING: rb_raise(rb_eTypeError, "no implicit conversion from string"); - return Qnil; /* not reached */ + break; case T_TRUE: case T_FALSE: rb_raise(rb_eTypeError, "no implicit conversion from boolean"); - return Qnil; /* not reached */ + break; default: val = rb_to_int(val); return NUM2ULL(val); } + + UNREACHABLE; } #endif /* HAVE_LONG_LONG */ Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 34818) +++ vm_insnhelper.c (working copy) @@ -429,7 +429,7 @@ call_cfunc(VALUE (*func)(), VALUE recv, break; default: rb_raise(rb_eArgError, "too many arguments(%d)", len); - return Qundef; /* not reached */ + UNREACHABLE; } } Index: ruby.c =================================================================== --- ruby.c (revision 34818) +++ ruby.c (working copy) @@ -1749,7 +1749,8 @@ opt_W_getter(ID id, void *data) case Qtrue: return INT2FIX(2); } - return Qnil; /* not reached */ + + UNREACHABLE; } void Index: bignum.c =================================================================== --- bignum.c (revision 34818) +++ bignum.c (working copy) @@ -3671,8 +3671,8 @@ rb_big_coerce(VALUE x, VALUE y) rb_raise(rb_eTypeError, "can't coerce %s to Bignum", rb_obj_classname(y)); } - /* not reached */ - return Qnil; + + UNREACHABLE; } /* Index: file.c =================================================================== --- file.c (revision 34818) +++ file.c (working copy) @@ -4386,7 +4386,8 @@ rb_f_test(int argc, VALUE *argv) else { rb_raise(rb_eArgError, "unknown command \"\\x%02X\"", cmd); } - return Qnil; /* not reached */ + + UNREACHABLE; }