Re: is -w really useful?



Wybo Dekker wrote:
I would like to use the -w commandline option always, but any useful output is always obscured by message from the standard libraries:

For example:

/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.7/lib/rio/if/grande.rb:404: warning: useless use of > in void context
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.7/lib/rio/if/grande.rb:580: warning: useless use of < in void context
/usr/local/lib/ruby/1.8/tk.rb:2313: warning: redefine encoding=
/usr/local/lib/ruby/1.8/tk.rb:2316: warning: redefine encoding
/usr/local/lib/ruby/1.8/tk/font.rb:718: warning: instance variable @compoundfont not initialized
/usr/local/lib/ruby/1.8/tk/font.rb:671: warning: instance variable @compoundfont not initialized
/usr/local/lib/ruby/1.8/tk/font.rb:718: warning: instance variable @compoundfont not initialized
/usr/local/lib/ruby/1.8/tk/font.rb:671: warning: instance variable @compoundfont not initialized
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.7/lib/rio/rl/uri.rb:78: warning: method redefined; discarding old base=
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.7/lib/rio/cp.rb:209: warning: useless use of < in void context
/usr/local/lib/ruby/gems/1.8/gems/rio-0.3.7/lib/rio/cp.rb:309: warning: useless use of > in void context

Should such messages not be banned?


Some warnings are really just informational. For example, redefining a method isn't 'wrong,' and it can be how your program is supposed to function. Or having an uninitialized instance variable might not matter - after all, I don't think there is a difference between that and setting it to nil.

However, it could be dangerous or unintentional, so you get a warning. As with all debugging output, you have to filter through it sometimes.

-Justin


.