FFI non-string args for methods are turned into strings anyway
--------------------------------------------------------------
Key: JRUBY-3408
URL: http://jira.codehaus.org/browse/JRUBY-3408
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1.6
Environment:
« Hide
java version "1.5.0_16" / Java(TM) 2 Runtime Environment, Standard Edition
(build 1.5.0_16-b06-284) / Java HotSpot(TM) Client VM (build 1.5.0_16-133,
mixed mode, sharing)
JRuby 1.1.6
MacOSX 10.5.6
Reporter: John Mettraux
Assignee: Thomas E Enebo
Priority: Minor
http://gist.github.com/65150
require 'rubygems'
require 'ffi'
module Hello
extend FFI::Library
attach_function 'puts', [ :string ], :int
end
Hello.puts("1")
Hello.puts(1)
# jmettraux:~/tmp/ffi$ ruby auto_string.rb
# 1
# (eval):3:in `call1': Invalid String value (ArgumentError)
# from (eval):3:in `puts'
# from auto_string.rb:12
# jmettraux:~/tmp/ffi$ ruby19 auto_string.rb
# 1
# (eval):3:in `call1': Invalid String value (ArgumentError)
# from (eval):3:in `puts'
# from auto_string.rb:12:in `<main>'
# jmettraux:~/tmp/ffi$ jruby-1.1.6 auto_string.rb
# 1
# 1
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email