[cffi-devel] vararg (was: CFFI/CLISP - 2 out of 101 total tests f ailed)

Yaroslav Kavenchuk kavenchuk at jenty.by
Wed Jan 4 12:01:34 UTC 2006


Hoehle, Joerg-Cyril wrote:

> Yaroslav, I'd be grateful if you could express the testcase in terms of
> CLISP FFI forms (not CFFI) and submit it to the SF CLISP bugtracker,
> mentioning varargs in the subject line. So the clisp project would have
> a bugtracker issue for varargs and a place where to post comments.
> 

Hmm, sprintf under mingw not work with double/single-float without any
varargs:

check:

(ffi:def-call-out sprintf-int (:name "sprintf") (:return-type nil)
  (:library :default) (:language :stdc)
  (:arguments
    (out-str (ffi:c-ptr (ffi:c-array-max character 256)) :out :alloca)
    (fmt ffi:c-string) (n ffi:int)))
SPRINTF-INT
(sprintf-int "%d" 100)
"100"

double:

(ffi:def-call-out sprintf-double (:name "sprintf") (:return-type nil)
  (:library :default) (:language :stdc)
  (:arguments
    (out-str (ffi:c-ptr (ffi:c-array-max character 256)) :out :alloca)
    (fmt ffi:c-string) (n ffi:double-float)))
SPRINTF-DOUBLE
(sprintf-double "%.2f" 3.14d0)
"X\""

Perhaps, reason in it?

Thanks!

-- 
WBR, Yaroslav Kavenchuk.



More information about the cffi-devel mailing list