[cffi-devel] MEM-REF and BARE-STRUCT-TYPE-P issue

Liam Healy lnp at healy.washington.dc.us
Sat Jan 19 15:30:22 UTC 2013


On Sat, Jan 19, 2013 at 1:25 AM, CRLF0710 <crlf0710 at gmail.com> wrote:

> Hi all.
>
> #1 In src/types.lisp there is following code in function MEM-REF:
> ....
>     (if (aggregatep parsed-type)
>         (if (bare-struct-type-p parsed-type)
> ....
> and its compiler macro has similiar code.
> However, the gf bare-struct-type-p has no method for  foreign-array-type
> whose objects will obviously pass the aggregatep test. So it breaks some
> code (on ccl).
> I suggest that case be added as a method too?(What should it (and even
> more user-defined types) return?) Or should the checking code be modified
> here? (As i understood, the whole bare struct mechanism is for
> compatibility...)
>

I would prefer to leave the question of aggregate definition to someone
else, as I am not clear on what constitutes an aggregate.  However, if you
find code breaking, please post a "before and after" minimal example with
the previous correct result and the current wrong result.  If you have a
proposed method to fix the problem, can you add that to your branch and do
a pull request?


>
> #2 And another thing, i've realized that in my last modification to the
> STRUCTURE-BY-VALUE-P function (the modification is already pushed to the
> repo) i should have tested to see if it is a bare struct type. Without the
> check it will put some deprecated style code into using libffi, which also
> works correctly but involves unnecessary libffi dependency. Should I fix
> that?
>

Yes, please.


> Regards,
> Charles Lew
>

Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20130119/28734da7/attachment.html>


More information about the cffi-devel mailing list