Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 186838 - dev-ruby/ruby-pcap displays "warning: do not use Fixnums as Symbols" at runtime PATCH PROVIDED
Summary: dev-ruby/ruby-pcap displays "warning: do not use Fixnums as Symbols" at runti...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Ruby Team
URL: http://www.yob.id.au/blog/2007/03/06/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-27 19:56 UTC by Kevin Worth
Modified: 2007-08-04 19:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Worth 2007-07-27 19:56:32 UTC
It appears that this is due to the fact that this code is about 7 years old now...

Ideally this should probably be pushed upstream, and I have contacted the author fukusima at goto.info.waseda.ac.jp about releasing a patched version, but I'm not sure if I'll get a response.

See below for patch.

Reproducible: Always

Steps to Reproduce:
install ruby-pcap
attempt to require pcaplet in any ruby program (even the one-liner below works)
$ruby -e "require 'pcaplet'"
Actual Results:  
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use Fixnums as Symbols
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use Fixnums as Symbols
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use Fixnums as Symbols


Expected Results:  
Nothing, the file should be included silently

--- Pcap.c.orig 2007-07-27 12:44:55.000000000 -0700
+++ Pcap.c      2007-07-27 12:45:22.000000000 -0700
@@ -782,9 +782,9 @@
     /* define class PcapStat */
     cPcapStat = rb_funcall(rb_cStruct, rb_intern("new"), 4,
                           Qnil,
-                          INT2NUM(rb_intern("recv")),
-                          INT2NUM(rb_intern("drop")),
-                          INT2NUM(rb_intern("ifdrop")));
+                          ID2SYM(rb_intern("recv")),
+                          ID2SYM(rb_intern("drop")),
+                          ID2SYM(rb_intern("ifdrop")));
     rb_define_const(mPcap, "Stat", cPcapStat);

     /* define exception classes */
Comment 1 Hans de Graaff gentoo-dev Security 2007-08-04 19:38:37 UTC
Thanks, I've added the patch to CVS directly to ruby-pcap-0.6.

In the future, please include the patch as an attachment, even if it is as small as this one, so that whitespace won't get mangled. Keeps me from reproducing the patch myself. :-)