Project

General

Profile

Actions

Bug #18433

closed

「‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1.」が 3.1 でも出力される

Added by tommy (Masahiro Tomita) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
[ruby-dev:51128]

Description

拡張ライブラリ内で rb_cData を使うと

‘rb_cData’ is deprecated: by: rb_cObject.  Will be removed in 3.1.

という warning が出力されますが、これが 3.1 でも出ます。
別に害はないのですが、メッセージとしては妙な感じです。

/tmp/hoge% cat hoge.c 
#include <ruby.h>
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% 

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

忘れてました。
予定は未定ということで、3.2になったら消します(たぶん)。

Actions #2

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|7c738ce5e649b82bdc1305d5c347e81886ee759a.


Remove deprecate rb_cData [Bug #18433]

Also enable the warning for T_DATA allocator.

Actions

Also available in: Atom PDF

Like0
Like0Like0