inconsistent handling of arrays in structs

Bug #1473612 reported by 3b
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
New
Undecided
Unassigned

Bug Description

(asdf:load-system 'cffi)

(cffi:defcstruct (v3 :class v3)
  (x :float)
  (y :float)
  (z :float))

(cffi:defcstruct v3x2
  (c :char :count 2)
  (v (:struct v3) :count 2))

(cffi:with-foreign-object (x '(:struct v3x2))
  (list (cffi:mem-ref x '(:struct v3x2))
        :c (cffi:foreign-slot-value x '(:struct v3x2) 'c)
        :v (cffi:foreign-slot-value x '(:struct v3x2) 'v)))

=->

((V (Z 0.0 Y 4.2038954e-43 X 0.0)
  C #.(SB-SYS:INT-SAP #X7FFFD68CFFD8))
 :C #.(SB-SYS:INT-SAP #X7FFFD68CFFD8)
 :V (Z 0.0 Y 4.2038954e-43 X 0.0))

expected either SAP for both V and C, or preferably a lisp sequence of 2 elements for each.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.