From: ruby@...1.net Date: 2014-12-23T02:31:14+00:00 Subject: [ruby-core:67055] [ruby-trunk - Bug #10635] [Open] cmp_failed warnings in 2.2 are very hard to track down Issue #10635 has been reported by Aman Gupta. ---------------------------------------- Bug #10635: cmp_failed warnings in 2.2 are very hard to track down https://bugs.ruby-lang.org/issues/10635 * Author: Aman Gupta * Status: Open * Priority: Normal * Assignee: * Category: * Target version: current: 2.2.0 * ruby -v: ruby 2.2.0dev * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- I propose we add the exception (and possibly backtrace as well) to show the root cause of the warning. ~~~ diff --git a/compar.c b/compar.c index 81dff38..70d08ca 100644 --- a/compar.c +++ b/compar.c @@ -68,10 +68,11 @@ cmp_eq(VALUE *a) } static VALUE -cmp_failed(void) +cmp_failed(VALUE args, VALUE exception_object) { rb_warn("Comparable#== will no more rescue exceptions of #<=> in the next release."); rb_warn("Return nil in #<=> if the comparison is inappropriate or avoid such comparison."); + rb_warn("Exception: %"PRIsVALUE, rb_inspect(exception_object)); return Qfalse; } ~~~ cc #7688 -- https://bugs.ruby-lang.org/