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. --- variable.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 362ccddc13..4d62361fd0 100644 --- a/variable.c +++ b/variable.c @@ -277,6 +277,7 @@ rb_path_to_class(VALUE pathname) undefined_class: rb_raise(rb_eArgError, "undefined class/module % "PRIsVALUE, rb_str_subseq(pathname, 0, p-path)); + UNREACHABLE_RETURN(Qundef); } VALUE @@ -3347,6 +3348,7 @@ rb_mod_remove_cvar(VALUE mod, VALUE name) not_defined: rb_name_err_raise("class variable %1$s not defined for %2$s", mod, name); + UNREACHABLE_RETURN(Qundef); } VALUE -- cgit v1.2.3