[#51116] [Ruby master Bug#18383] When I access to localhost:3000, got "Don't forget to include the Crash Report log file under DiagnosticReports directory in bug reports" — "yuuyake9191 (Daime Tatsuru)" <noreply@...>

Issue #18383 has been reported by yuuyake9191 (Daime Tatsuru).

10 messages 2021/12/03

[ruby-dev:51128] [Ruby master Bug#18433] 「‘rb_cData’ is deprecated: by: rb_cObject. Will be removed in 3.1.」が 3.1 でも出力される

From: "tommy (Masahiro Tomita)" <noreply@...>
Date: 2021-12-26 03:07:14 UTC
List: ruby-dev #51128
Issue #18433 has been reported by tommy (Masahiro Tomita).

----------------------------------------
Bug #18433: 「‘rb_cData’ is deprecated: by: rb_cObject.  Will be removed in 3.1.」が 3.1 でも出力される
https://bugs.ruby-lang.org/issues/18433

* 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 <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% 
```



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next