[Ecls-list] C-INLINE and LET bindings

Marco Gidde marco.gidde at tiscali.de
Sat Dec 30 15:18:04 UTC 2006


Hello Juanjo (et al.),

while playing around with ECL and CFFI I got a strange compiler error
that did not occur with e.g. SBCL. I was able to strip it down to the
following code:

(defun c-malloc-1 (x)
  (ffi:clines "#include <stdlib.h>")
  (ffi:c-inline (x) (:int) :pointer-void "malloc(#0)" :one-liner t))

(defun c-malloc-2 (x)
  (ffi:clines "#include <stdlib.h>")
  (let ((gaga (ffi:c-inline (x) (:int) :pointer-void "malloc(#0)"
			    :one-liner t)))
    gaga))

Both functions are the same except for the superfluous LET in
C-MALLOC-2. The problem is that the first form compiles while the
second doesn't. The error message is

> ;;; Compiling ecl.lsp.
> ;;; Compiling (DEFUN C-MALLOC-2 ...).
> Not a condition type: C::FOREIGN-DATA
> No restarts available.
> Broken at MAKE-CONDITION.

ECL is from CVS, updated last Monday or so, running on GNU/Linux
x86_64 with a 2.6.11.4-21.12 kernel.

Btw., why is there no support for object finalization in CFFI/ECL?


Regards,

Marco






More information about the ecl-devel mailing list