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. --- error.c | 1 + 1 file changed, 1 insertion(+) (limited to 'error.c') diff --git a/error.c b/error.c index 5cb808fb44..ce936ac568 100644 --- a/error.c +++ b/error.c @@ -930,6 +930,7 @@ rb_check_typeddata(VALUE obj, const rb_data_type_t *data_type) const char *expected = data_type->wrap_struct_name; rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (expected %s)", actual, expected); + UNREACHABLE_RETURN(NULL); } /* exception classes */ -- cgit v1.2.3