[cffi-devel] vararg (was: CFFI/CLISP - 2 out of 101 total tes ts failed)
Hoehle, Joerg-Cyril
Joerg-Cyril.Hoehle at t-systems.com
Fri Jan 6 08:54:37 UTC 2006
Yaroslav Kavenchuk wrote:
>> Oops, if use libintl_sprintf instead of sprintf - all works:
>> Hmm. I do not know why sprintf function does not work in clisp/mingw.
>if define sprintf as function from msvcrt.dll - all works:
Oh boy!
>Why there is no opportunity to specify from what library link function?
You probably mean in CFFI? UFFI has :module and CLISP has :library
>And if I shall link some libraries with identical names of functions -
>what to do?
"Implementation-dependent" and underspecified
On many UNIX systems, the more recently opened libraries probably shadow older ones.
Now, do you know in which order the libraries where opened? The general answer is "no". E.g. did you read somewhere in clisp impnotes in what order it's reopening libraries when restarting from an image?
Do you know what libraries got loaded in what order, when you're just a library programmer and don't know what the user is doing (and what s/he loaded)?
No, you don't.
There are several reasons why I prefer programmers to state which library or module thex expect a function to come from. It helps do the right thing.
(But the most important reason back in 1995 was that the Amiga had no introspection of shared libraries. You *had* to tell you want e.g. Close from *that* specific library, and it was a reasonably way to avoid conflicts).
>I do not know what library contains bad sprintf function.
Maybe you can figure it out using (foreign-address #<foreign-function>) and see if you can relate that to the addresses of the .dll loaded into the current process?
Regards,
Jorg Hohle
More information about the cffi-devel
mailing list