I think there is a bug in CFFI with CCL's 32-bit version:

(cffi:defcunion foo-union
  (int16    :int16  )
  (uint64   :uint64 )
  )

(cffi:defcstruct bar-struct
  (tag :uint8)
  (val foo-union))

(defun foo ()
  (cffi:with-foreign-string (data "0123456789" :encoding :latin-1)
    (- (cffi:pointer-address (cffi:foreign-slot-value data 'bar-struct 'val))
       (cffi:pointer-address data))))


FOO returns 4 in SBCL and Lispworks but with CCL it's 8.

Helmut


 


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

Reply via email to