[fetter-devel] wrong code generated

Rayiner Hashem rayiner at gmail.com
Thu Oct 27 17:38:22 UTC 2005


On 27 Oct 2005 16:06:56 +0200, Immanuel Litzroth <immanuell at enfocus.be> wrote:
> A header containing only:
> typedef long long unsigned int tp;
> generates:
> (defpackage "TEST" (:use #:CFFI) (:nicknames) (:export "TP"))
>
> (in-package "TEST")
> (asdf:operate 'asdf:load-op 'verrazano-support)
> (cffi:define-foreign-type tp () 'long long unsigned int)
> (cl:progn)
>
> which is nonsense to cffi.
> This is sbcl-0.9.6, fetter+cffi from cvs, linux.

Now, this is an interesting problem. There are a number of issues with
"long long" that keep cropping up. To be pedantic, "long long" isn't a
valid C++ type. This is not in and of itself a problem, because
GCC-XML accepts it anyway and the only thing Vzn needs to do is have
it in its type translation table (apparently, I've missed a few
permutations of it, though). The bigger problem is that there is
nothing sensible to map "long long" too, at least on a 32-bit system.
On such a system, long long maps to a 64-bit word (a pair of 32-bit
registers), and there is no way to express that in C-FFI. Anybody have
any ideas?

Sincerely,
    Rayiner Hashem

> Immanuel
>
> ***************************************************************************
> I can, I can't.
> Tubbs Tattsyrup
>
> --
> Immanuel Litzroth
> Software Development Engineer
> Enfocus Software
> Antwerpsesteenweg 41-45
> 9000 Gent
> Belgium
> Voice: +32 9 269 23 90
> Fax : +32 9 269 16 91
> Email: Immanuell at enfocus.be
> web : www.enfocus.be
> ***************************************************************************
>
> _______________________________________________
> 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