diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-24 16:23:59 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-06-29 11:05:41 +0900 |
commit | de3e931df7abdc3ee22dbb7543e86af6d00ee899 (patch) | |
tree | 63f8471b59282d2ca5e7af0282f34d9cfef14ee1 /string.c | |
parent | c8dc2bf1401fc01d35a4a7587ed224f1f2fe29e6 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3015,6 +3015,7 @@ rb_enc_cr_str_buf_cat(VALUE str, const char *ptr, long len, incompatible: rb_raise(rb_eEncCompatError, "incompatible character encodings: %s and %s", rb_enc_name(str_enc), rb_enc_name(ptr_enc)); + UNREACHABLE_RETURN(Qundef); } VALUE @@ -9679,6 +9680,7 @@ rb_str_crypt(VALUE str, VALUE salt) short_salt: rb_raise(rb_eArgError, "salt too short (need >=2 bytes)"); + UNREACHABLE_RETURN(Qundef); } |