I'm sorry to have to correct myself within seconds of hitting the "send button":
I don't know the MS-Windows APIs and never looked for a testcase. Indeed, it needs to involve callbacks to show the difference AFAIK.
This applies to CLISP only, because ffcall library will fix the stack pointer for direct calls. But in other Lisps which might inline te call to the function function, the stack pointer may get messed up even in direct calls.
Regards, Jörg Höhle.
Please find attached two variations of the same test, which is to invoke the EnumWindows Win32 API with a callback that simply prints a message confirming that it was called (which occurs once for each top-level window).
After loading either of these files, run (callback-test) to execute the test.
stdcall-test-clisp.lisp uses the CLISP FFI. Note that it specifies :stdc-stdcall as the calling convention. This test executes correctly as expected.
stdcall-test-cffi.lisp is the same but written in CFFI terms, except that stdcall is not available. This variant will crash clisp -- although circumstances may vary, so you probably need to execute (callback-test) in a loop to be sure.
-- Jack Unrue