On 2006-maj-13, at 23:56, Ken Tilton wrote:
As the subject suggests, methinks the defcallback macro knows about IGNORE but not IGNORABLE. I use the latter a lot because of debug statements that come and go.

Hmm, we're putting the declarations in the wrong place.

(defcallback foo :int ((a :int) (b :int))
  (declare (ignorable b))
  a)

Macroexpands into something like:

(FOREIGN-FUNCTIONS:DEFUN-FOREIGN-CALLABLE
  CFFI-CALLBACKS::|CFFI::FOO| ((A :INT) (B :INT))
  (DECLARE (:CONVENTION :C))
  (DECLARE (IGNORABLE B))
  (LET ((A (VALUES A)))
    (LET ((B (VALUES B)))
      ;; Allegro will warn here because this new B is unused.
      ;;
      ;; Perhaps the declarations should go here?
      ;; (except for IGNORE declarations and maybe others?)
      (BLOCK FOO A))))

--
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/


_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to