From: Bob Alexander Date: 2001-10-25T05:56:26+09:00 Subject: [ruby-talk:23225] Erroneous warning: block for Proc#call is useless Ruby sometimes invalidly outputs the warning: sig.rb:10: warning: block for Proc#call is useless Some time ago I attempted to report this problem, but couldn't make a simple test case to reproduce it. Well, it happened again and I got a better handle on it this time -- it's related to signals. I'm using version 1.6.5. Below is a little test program that can repeatably produce the situation on both Linux (Mandrake 8.0) and FreeBSD (4.0). You'll need 2 shells: In shell 1, run "ruby -w sig.rb". The program will print its PID and start silently looping. In shell 2, run "ruby sig.rb PID" using the PID printed by shell 1. It will continuously send signals to the shell 1 process, and shell 1 will start displayng warnings. Hit ^C in shell 2, the warnings will stop. Bob -------- sig.rb ------------------ if pid = ARGV[0] pid = Integer(pid) while true Process.kill("USR1", pid) end else puts Process.pid trap("USR1") {} while true open("sig.rb", "r") do |f| f.read() end end end ----------------------------------