From de3e931df7abdc3ee22dbb7543e86af6d00ee899 Mon Sep 17 00:00:00 2001 From: 卜部昌平 Date: Wed, 24 Jun 2020 16:23:59 +0900 Subject: add UNREACHABLE_RETURN Not every compilers understand that rb_raise does not return. When a function does not end with a return statement, such compilers can issue warnings. We would better tell them about reachabilities. --- io.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index 36099d89ad..21bf79796a 100644 --- a/io.c +++ b/io.c @@ -4199,6 +4199,7 @@ rb_io_each_codepoint(VALUE io) invalid: rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc)); + UNREACHABLE_RETURN(Qundef); } /* @@ -5578,6 +5579,7 @@ rb_io_modestr_fmode(const char *modestr) error: rb_raise(rb_eArgError, "invalid access mode %s", modestr); + UNREACHABLE_RETURN(Qundef); } int -- cgit v1.2.3