I've run into a problem where populating a foreign structure and then passing it to a foreign function behaves correctly if my Lisp code is interpreted, but the structure fields appear to be corrupted if my function is compiled. This is with CFFI versions later than 0.9.0, and on LW 4.4.6 under WinXP.
When I invoke the dump-it function in interpreted mode, the output file contains the expected result:
cbSize: 4 style: 01abcdef
When I (compile 'dump-it) and then invoke it, the output file contains garbage:
cbSize: -1412567292 style: 01abcd01
This testcase works fine with the same LW version but CFFI 0.9.0. It also works fine with CLISP 2.38 and latest CFFI.
CFFI versions 0.9.1, 060514, and a build produced from a darcs pull today all show the problem on LW. I haven't tried bisecting any further.
See attached testcase.lisp and structs.c. I've also attached a simple Makefile for compiling with gcc. The foreign function dump_blah writes a file called 'dump_output.txt' in the current working directory.