Bug in alien-funcall with c-call:char as a result type
Describe the bug
When you specify return type to be c-call:char
, it seems to be equivalent to c-call:int
.
To Reproduce
(alien:alien-funcall (alien:extern-alien "abs" (function c-call:char c-call:int))
1000)
; => 1000 ; not char!
Desktop (please complete the following information):
- OS: Linux
- CPU: running x86 version on x86-64
- Version: 21e
Additional context
This causes a test failure in cffi (MISC-TYPES.BOOL.CONVERT-FROM-FOREIGN.CALL test)
See C function definition, CL foreign function definition, Test definition.
Problem is that alien:alien-funcall
returns :int
instead of :char
:
(alien:alien-funcall (alien:extern-alien "unsigned_to_bool"
(function c-call:char c-call:unsigned-int))
0)
; => #x-8168100 ; (should be 0, as if it returned the last byte only)
(alien:alien-funcall (alien:extern-alien "unsigned_to_bool"
(function c-call:char c-call:unsigned-int))
1)
; => #x-81680FF ; (should be 1, as if it returned the last byte only)