From de3e931df7abdc3ee22dbb7543e86af6d00ee899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= 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. --- string.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 903222e0e4..8bcc6bb9c8 100644 --- a/string.c +++ b/string.c @@ -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); } -- cgit v1.2.3