aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 05:29:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-27 05:29:49 +0000
commitd226ce8decef356c7447efb6b6b325bc8fc53dba (patch)
treefc6ee90568444f58aeea654c4f2326cb5b1f73ae
parentf8fe5349802f2d73a70b0b7a190a3c7071efa0f4 (diff)
downloadruby-d226ce8decef356c7447efb6b6b325bc8fc53dba.tar.gz
internal.h: ONLY_FOR_INTERNAL_USE
* error.c (ruby_only_for_internal_use): raise fatal error when deprecated function only for internal use is called, not just a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--error.c10
-rw-r--r--internal.h2
-rw-r--r--pack.c6
-rw-r--r--vm.c3
-rw-r--r--vm_method.c4
6 files changed, 22 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index e13a225..3ca07fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Apr 27 14:29:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * error.c (ruby_only_for_internal_use): raise fatal error when
+ deprecated function only for internal use is called, not just a
+ warning.
+
Tue Apr 26 23:42:30 2016 NAKAMURA Usaku <usa@ruby-lang.org>
* tool/redmine-backporter.rb (rel): should not raise exceptions even if
diff --git a/error.c b/error.c
index 214d12d..5a0184f 100644
--- a/error.c
+++ b/error.c
@@ -124,16 +124,26 @@ rb_syntax_error_append(VALUE exc, VALUE file, int line, int column,
void
rb_compile_error_with_enc(const char *file, int line, void *enc, const char *fmt, ...)
{
+ ONLY_FOR_INTERNAL_USE("rb_compile_error_with_enc()");
}
void
rb_compile_error(const char *file, int line, const char *fmt, ...)
{
+ ONLY_FOR_INTERNAL_USE("rb_compile_error()");
}
void
rb_compile_error_append(const char *fmt, ...)
{
+ ONLY_FOR_INTERNAL_USE("rb_compile_error_append()");
+}
+
+void
+ruby_only_for_internal_use(const char *func)
+{
+ rb_print_backtrace();
+ rb_fatal("%s is only for internal use and deprecated; do not use", func);
}
static VALUE
diff --git a/internal.h b/internal.h
index 9ca1fb3..b51a751 100644
--- a/internal.h
+++ b/internal.h
@@ -865,6 +865,8 @@ VALUE rb_name_err_new(VALUE mesg, VALUE recv, VALUE method);
rb_exc_raise(rb_name_err_new(mesg, recv, name))
#define rb_name_err_raise(mesg, recv, name) \
rb_name_err_raise_str(rb_fstring_cstr(mesg), (recv), (name))
+NORETURN(void ruby_only_for_internal_use(const char *));
+#define ONLY_FOR_INTERNAL_USE(func) ruby_only_for_internal_use(func)
/* eval.c */
VALUE rb_refinement_module_get_refined_class(VALUE module);
diff --git a/pack.c b/pack.c
index 9b4aa6a..ea7bd16 100644
--- a/pack.c
+++ b/pack.c
@@ -220,15 +220,13 @@ str_associated(VALUE str)
void
rb_str_associate(VALUE str, VALUE add)
{
- rb_warn("rb_str_associate() is only for internal use and deprecated; do not use");
- str_associate(str, add);
+ ONLY_FOR_INTERNAL_USE("rb_str_associate()");
}
VALUE
rb_str_associated(VALUE str)
{
- rb_warn("rb_str_associated() is only for internal use and deprecated; do not use");
- return str_associated(str);
+ ONLY_FOR_INTERNAL_USE("rb_str_associated()");
}
/*
diff --git a/vm.c b/vm.c
index 77f57d9..94fbfdd 100644
--- a/vm.c
+++ b/vm.c
@@ -459,8 +459,7 @@ rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
void
rb_frame_pop(void)
{
- rb_thread_t *th = GET_THREAD();
- vm_pop_frame(th);
+ ONLY_FOR_INTERNAL_USE("rb_frame_pop()");
}
/* at exit */
diff --git a/vm_method.c b/vm_method.c
index 2d3e78c..90d5437 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -83,9 +83,7 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg)
void
rb_clear_cache(void)
{
- rb_warning("rb_clear_cache() is deprecated.");
- INC_GLOBAL_METHOD_STATE();
- INC_GLOBAL_CONSTANT_STATE();
+ ONLY_FOR_INTERNAL_USE("rb_clear_cache()");
}
void