Issue #16522 has been updated by jeremyevans0 (Jeremy Evans).

Backport changed from 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED
Status changed from Open to Closed
File scan-args-deprecated-warn-16522.patch added

I took another look at this and I think we can silence the deprecation warnings with `-W:no-deprecated` even if we can't deduplicate the warnings.  Attached is a patch that implements this.  I'm not sure if the approach in ruby.h is acceptable (rb_scan_args has both an unoptimized version in class.c and an optimized version in ruby.h).

----------------------------------------
Bug #16522: Ruby 2.7 logs deprecation warning when Warning[:deprecated] is set to false.  
https://bugs.ruby-lang.org/issues/16522#change-85871

* Author: snehasomwanshi / gmail.com (Sneha Somwanshi)
* Status: Closed
* Priority: Normal
* ruby -v: 2.7
* Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED
----------------------------------------
Hi 

While upgrading our monolithic app to ruby 2.7, we realised that ruby 2.7 is not suppressing all deprecation warnings. 

Here is the test case:

```
~/dev/freeagent (ruby_2_7_0 *%) $ ruby -W:no-deprecated -e 'require "json"; JSON::Ext::Parser.new("hello", {})'
-e:1: warning: Using the last argument as keyword parameters is deprecated
```

The warning is originating from https://github.com/ruby/ruby/blob/647ee6f091eafcce70ffb75ddf7e121e192ab217/class.c#L2054 and setting  `Warning[:deprecated] = false` or `RUBYOPT=-W:no-deprecated -W:no-experimental` does not suppress this warning.

---Files--------------------------------
scan-args-deprecated-warn-16522.patch (6.79 KB)


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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>