ruby-changes:62081
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 29 Jun 2020 11:49:35 +0900 (JST)
Subject: [ruby-changes:62081] 94ab244b43 (master): rb_class_modify_check: add UNREACHABLE
https://git.ruby-lang.org/ruby.git/commit/?id=94ab244b43 From 94ab244b43e1aa59dfef9f200b1c253f70975c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Mon, 29 Jun 2020 11:43:48 +0900 Subject: rb_class_modify_check: add UNREACHABLE (I was not aware of this because I use clang, but) it seems gcc cannot detect reachablility of this point. It renders an unused variable warning, which is a false positive. Let us suppress the compiler. https://github.com/ruby/ruby/runs/816997191#step:9:62 diff --git a/eval.c b/eval.c index 03a1972..52f3cc4 100644 --- a/eval.c +++ b/eval.c @@ -489,6 +489,7 @@ rb_class_modify_check(VALUE klass) https://github.com/ruby/ruby/blob/trunk/eval.c#L489 break; default: Check_Type(klass, T_CLASS); + UNREACHABLE; } } rb_frozen_error_raise(klass, "can't modify frozen %s: %"PRIsVALUE, desc, klass); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/