-
Notifications
You must be signed in to change notification settings - Fork 6
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
The value "xxx" is not of type SB-SYS:SYSTEM-AREA-POINTER when binding SB-ALIEN::VALUE #11
Comments
I can't reproduce. Could you give stack trace? You may also try these simpler examples first: (from '("<string>") 'import '("[](std::string x){return \"Hi, \"+x;}" . "hi"))
(hi "there!")
(from '("<cmath>") 'import '("static_cast<double(*)(double)>(std::sin)" . "cpp-sin"))
(cpp-sin 0d0)
(cpp-sin pi)
(cpp-sin (/ pi 2)) |
@Islam0mar (I'll prepare full stacktrace. Please wait a moment.) |
This is full log of above.
|
And this is same for SDL2.
|
can you try this code please: (cffi:with-foreign-pointer-as-string (str 255)
(hi (cffi:lisp-string-to-foreign "blablabla" str 10))) after |
@Islam0mar
|
This deduced type is not string which is quite strange. It should match here and return If otherwise you would convert every string to c pointer for now :(. |
@Islam0mar
I also write here my clang version.
|
can you try these:
You can change compiler |
Thank you. I'll try this next :) |
I don't have access to mac ATM. when you have time, you can change cffi-type to: (defun cffi-type (type)
"Returns cffi-type as a keyword"
(declare (type string type))
(print type) ;; added THIS LINE <=================================
(let ((type-symbol (cdr (assoc type
*cxx-type-name-to-cffi-type-symbol-alist*
:test #'string-equal))))
(cond
(type-symbol type-symbol)
((eq #\* (elt type (1- (length type)))) :pointer)
(t (format t "No Known conversion for type ~S. default to pointer~%" type) :pointer)))) Thus we know how c++ deduced string type. |
I tried another clang compiler with Homebrew, but nothing seems to be changed.
# clang versions used above:
$ /opt/homebrew/opt/llvm/bin/clang++ --version
Homebrew clang version 19.1.2
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /opt/homebrew/Cellar/llvm/19.1.2/bin
# system clang versions
$ /usr/bin/g++ --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ /usr/bin/clang --version
Apple clang version 16.0.0 (clang-1600.0.26.4)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin |
OK. I also try this next time when I have time! |
I also tried
( # clang versions used above:
$ /opt/homebrew/opt/llvm@14/bin/clang --version
Homebrew clang version 14.0.6
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm@14/bin
$ /opt/homebrew/opt/llvm@13/bin/clang --version
Homebrew clang version 13.0.1
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm@13/bin |
My bad. godbolt Clang parse it as @funatsufumiya Add Thanks for reporting. I will fix it with PR tomorrow ISA. |
Awesome! I confirmed this issue was solved! Thanks to this (?), I confirmed SDL2 case showing another error, but this is maybe related to my environment. So I'll check this next time! (And this probably not directly related to this issue)
|
@funatsufumiya if the issue still exist kindly open a new one. |
README's examples gives me the same error when returning some value from C++ function.
debugger invoked on a TYPE-ERROR @70063008B4 in thread #<THREAD tid=259 "main thread" RUNNING {70083C05B3}>: The value "xxx" is not of type SB-SYS:SYSTEM-AREA-POINTER when binding SB-ALIEN::VALUE
For example, on SDL2 example,
(init)
works well, but(create-window ...)
gives this error.The text was updated successfully, but these errors were encountered: