From: "nobu (Nobuyoshi Nakada)" Date: 2021-12-26T04:51:56+00:00 Subject: [ruby-dev:51129] [Ruby master Bug#18433] 「‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1.」が 3.1 でも出力される Issue #18433 has been updated by nobu (Nobuyoshi Nakada). 忘れてました。 予定は未定ということで、3.2になったら消します(たぶん)。 ---------------------------------------- Bug #18433: 「‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1.」が 3.1 でも出力される https://bugs.ruby-lang.org/issues/18433#change-95634 * Author: tommy (Masahiro Tomita) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- 拡張ライブラリ内で rb_cData を使うと ``` ‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1. ``` という warning が出力されますが、これが 3.1 でも出ます。 別に害はないのですが、メッセージとしては妙な感じです。 ``` /tmp/hoge% cat hoge.c #include void Init_hoge(void) { rb_cData; } /tmp/hoge% cat extconf.rb require 'mkmf' create_makefile('hoge') /tmp/hoge% ruby -v extconf.rb ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux] creating Makefile /tmp/hoge% make compiling hoge.c hoge.c: In function ‘Init_hoge’: hoge.c:4:3: warning: ‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1. [-Wdeprecated-declarations] 4 | rb_cData; | ^~~~~~~~ In file included from /home/tommy/ruby31/include/ruby-3.1.0/ruby/internal/core.h:27, from /home/tommy/ruby31/include/ruby-3.1.0/ruby/ruby.h:28, from /home/tommy/ruby31/include/ruby-3.1.0/ruby.h:38, from hoge.c:1: /home/tommy/ruby31/include/ruby-3.1.0/ruby/internal/core/rdata.h:382:1: note: declared here 382 | rb_cData(void) | ^~~~~~~~ hoge.c: At top level: cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics linking shared-object hoge.so /tmp/hoge% ``` -- https://bugs.ruby-lang.org/