Feature #9502

Remove deprecated definitions

Added by Akira Tanaka over 1 year ago. Updated over 1 year ago.

[ruby-core:60581]
Status:Closed
Priority:Normal
Assignee:-

Description

I'd like to remove deprecated definitions.
This means C level API change.

The list of functions, macros and types are follows.
(This list doesn't contain definitions deprecated after 2.1.0 release.)

VA VD NAME
old 193 Check_SafeStr -> SafeStringValue
old 193 rb_check_safe_str -> SafeStringValue
old 193 rb_quad_pack -> rb_integer_pack
old 193 rb_quad_unpack -> rb_integer_unpack
old 193 rb_read_check : access struct FILE internal. no replacement.
old 193 rb_struct_iv_get : internal function. no replacement.
191 * struct rb_blocking_region_buffer : internal type. no replacement.
191 193 rb_thread_blocking_region_begin -> rb_thread_call_without_gvl family
191 193 rb_thread_blocking_region_end -> rb_thread_call_without_gvl family
old 193 TRAP_BEG -> rb_thread_call_without_gvl family
old 193 TRAP_END -> rb_thread_call_without_gvl family
old 193 rb_thread_select -> rb_thread_fd_select
191 * struct rb_exec_arg : internal type. no replacement.
191 200 rb_exec : internal function. no replacement.
191 200 rb_exec_arg_addopt : internal function. no replacement.
191 200 rb_exec_arg_fixup : internal function. no replacement.
191 200 rb_exec_arg_init : internal function. no replacement.
192 200 rb_exec_err : internal function. no replacement.
191 200 rb_fork : internal function. no replacement.
192 200 rb_fork_err : internal function. no replacement.
191 200 rb_proc_exec_n : internal function. no replacement.
191 200 rb_run_exec_options : internal function. no replacement.
192 200 rb_run_exec_options_err : internal function. no replacement.
191 200 rb_thread_blocking_region -> rb_thread_call_without_gvl family
old 200 rb_thread_polling -> rb_thread_wait_for
186 210 rb_big2str0 : internal function. no replacement.
193 210 rb_big2ulong_pack -> rb_integer_pack
193 210 rb_gc_set_params : internal function. no replacement.

VA is the version that the definition is available since.
"old" means it is available since 1.8.5 at least.

VD is the version that the definition is deprecated to cause warnings.
"*" means struct type.
struct types are not a target of deprecation warning.

It seems the half of definitions have replacements.

The rest are removed without replacement because they are ruby internals.

remove-deprecates.diff Magnifier (29.5 KB) Akira Tanaka, 02/08/2014 03:11 PM

Associated revisions

Revision 44955
Added by Akira Tanaka over 1 year ago

  • include/ruby/intern.h, include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [Feature #9502]

Revision 44955
Added by Akira Tanaka over 1 year ago

  • include/ruby/intern.h, include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [Feature #9502]

History

#1 Updated by Nobuyoshi Nakada over 1 year ago

Agree.
And today I've thought about deprecation of rb_argv0 too.

#2 Updated by Akira Tanaka over 1 year ago

We should provide a transition period.
So I didn't list definitions deprecated after Ruby 2.1 such as rb_str_associate.
They will be warned at Ruby 2.2 and can be removed at Ruby 2.3 or later.

rb_argv0 can be same as rb_str_associate if you deprecated it now.
But it is used in ext/tk.
So you need to remove the use before the deprecation.

#3 Updated by Yukihiro Matsumoto over 1 year ago

Agreed. Remove those functions (structs).

Matz.

#4 Updated by Akira Tanaka over 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r44955.


  • include/ruby/intern.h, include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [Feature #9502]

#5 Updated by Koichi Sasada over 1 year ago

I copied this table to the following page:
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/CAPI_ObsoleteFunctions

Maybe we can maintain this page for deprecated definitions.

#6 Updated by Koichi Sasada over 1 year ago

Koichi Sasada wrote:

I copied this table to the following page:
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/CAPI_ObsoleteFunctions

Not only functions. So I renamed to:
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/CAPI_obsolete_definitions

Also available in: Atom PDF