Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cffi-sys:%foreign-funcall doesn't pass the calling convention to si:call-cfun #26

Closed
davidmullen opened this issue Apr 28, 2024 · 2 comments
Assignees
Labels

Comments

@davidmullen
Copy link
Contributor

Technically an issue with CFFI, but it's in the contrib directory.

For cffi:foreign-funcall the default calling convention is :cdecl.

(require :asdf)
(require :cffi)

Then:

> (cffi:foreign-funcall "strlen" :string "foo" :int)

Debugger called in: #<thread "Initial" active (10204) 0x7f2cccf3c740 7f2cca4f1000>.

#<a SIMPLE-ERROR 139829904682848>:
    NIL does no denote a valid calling convention.

For mk_si_call_cfun the default calling convention is nil.

This function, si:call-cfun, is called from cffi-mkcl.lisp.

@jcbeaudoin jcbeaudoin added the bug label Apr 28, 2024
@jcbeaudoin jcbeaudoin self-assigned this Apr 28, 2024
@jcbeaudoin
Copy link
Owner

I goofed during a massive commit a while back. I did not transform properly the default value of two &optional arguments in src/c/ffi.c. I will commit the fix some time tonight. My sincere apologies for the inconvenience.

@jcbeaudoin
Copy link
Owner

commit e6d1df0 on master/head should be the needed fix. Please try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants