[fetter-devel] problem with arrays?
Carlos Ungil
ungil at mac.com
Fri Sep 2 11:05:23 UTC 2005
Hello,
thanks for your reply.
I tried to simplify the report, but I did simplify it too much :-)
In fact the error appears when I use the array in a structure:
-----[array.h]-----
typedef char char_array[10];
typedef struct two_char_arrays
{
char_array first;
char_array second;
} two_char_arrays;
----------
(cffi:define-foreign-type char-array () 'anonymous4713)
> CHAR-ARRAY
(cffi:defcstruct two-char-arrays-1 (first char-array) (second
char-array))
> Unknown CFFI type: ANONYMOUS4713.
By the way, I'm ignoring the (asdf:operate 'asdf:load-op
'verrazano-support) line.
I cannot find other references to "verrazano-support" anywhere. What's
it supossed to do?
Regards,
Carlos
On Sep 2, 2005, at 12:39 PM, Rayiner Hashem wrote:
> Not a bug, just an artifact of the fact that C-FFI doesn't have an
> array type, but Verrazano does. The C-FFI backend lowers arrays to
> bare pointers, so the code should still work.
>
> On the other hand, your comment made me realize quite a significant
> oversight with regards to arrays as arguments to virtual functions or
> members of arrays. I'll fix those shortly. Thanks!
>
> Sincerely,
> Rayiner Hashem
>
> On 9/2/05, Carlos Ungil <ungil at mac.com> wrote:
>>
>> I don't know if you're aware of this problem, I'm reporting it just in
>> case.
>>
>> From files
>>
>> -----[array.binding]-----
>> (defbinding "array-library"
>> (nicknames "array")
>> (include "array.h"))
>> ----------
>>
>> and
>>
>> -----[array.h]-----
>> typedef char char_array[10];
>> ----------
>>
>> (verrazano:create-binding "array.binding" "array-library.lisp"
>> :cffi-backend t)
>> produces the following output:
>>
>> -----[array-library.lisp]-----
>> (defpackage "ARRAY-LIBRARY" (:use #:COMMON-LISP #:CFFI) (:nicknames
>> "ARRAY")
>> (:export))
>>
>> (asdf:operate 'asdf:load-op 'verrazano-support)
>> (cffi:define-foreign-type char-array () 'anonymous12)
>> (progn)
>> ----------
>>
>> Anonymous12 is not defined anywhere; is this a bug or am I missing
>> something?
>>
>> Cheers,
>>
>> Carlos
>>
>> _______________________________________________
>> fetter-devel mailing list
>> fetter-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/fetter-devel
More information about the fetter-devel
mailing list