[#7055] More on VC++ 2005 — Austin Ziegler <halostatue@...>

Okay. I've got Ruby compiling. I'm attempting to get everything in

17 messages 2006/01/05
[#7058] Re: More on VC++ 2005 — nobuyoshi nakada <nobuyoshi.nakada@...> 2006/01/06

Hi,

[#7084] mathn: ugly warnings — hadmut@... (Hadmut Danisch)

Hi,

22 messages 2006/01/10
[#7097] Re: mathn: ugly warnings — Daniel Berger <Daniel.Berger@...> 2006/01/10

Hadmut Danisch wrote:

[#7098] Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/10

Daniel Berger wrote:

[#7118] Re: Design contracts and refactoring (was Re: mathn: ugly warnings) — mathew <meta@...> 2006/01/12

*Dean Wampler *<deanwampler gmail.com> writes:

[#7226] Fwd: Re: Question about massive API changes — "Sean E. Russell" <ser@...>

Hello,

23 messages 2006/01/28
[#7228] Re: Question about massive API changes — Caleb Tennis <caleb@...> 2006/01/28

>

[ ruby-Bugs-3267 ] Problem with Ruby/DL and double arguments (non-x86)

From: noreply@...
Date: 2006-01-17 13:49:13 UTC
List: ruby-core #7170
Bugs item #3267, was opened at 2006-01-17 13:37
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3267&group_id=426

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Sylvain Joyeux (lapinot)
Assigned to: Nobody (None)
Summary: Problem with Ruby/DL and double arguments (non-x86)

Initial Comment:
DL has a strange behaviour on my machine (Debian/PPC). This C code
[~/dl_test]% cat test.c
#include <stdio.h>
#include <math.h>

int called_by_dl(int first, double second)
{
    printf("called_by_dl(%i, %e) called\n", first, second);
    return (first == 1 && fabs(second - 0.02) < 0.00001);
}

and this Ruby code
[~/dl_test]% cat do_test.rb
require 'dl'
require 'pp'

test_lib  = DL.dlopen("./called_by_dl.so")
test_func = test_lib['called_by_dl', 'IID']
p test_func[1, 0.02]
p test_func[1, 0.02]

Gives the output:
[~/tmp/dl_test]% ruby do_test.rb
called_by_dl(1, 1.000000e+00) called
[0, [1, 0.02]]
called_by_dl(1, 2.000000e-02) called
[1, [1, 0.02]]

(i.e. first call is wrong, the second one is right)

I checked with i386 machines, where it works fine so I think it is related to the architecture. It would be nice to double-check on non-Debian non-x86 machines, but I have access to none.

Attached is the tarball with the two sources and the extconf.rb to compile the library


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1698&aid=3267&group_id=426

In This Thread

Prev Next