Luís Oliveira wrote:
Allegro resets the stack pointer to whatever value it had before pushing the foreign call's arguments to the stack. This approach works for either stdcall or cdecl.
I forgot this other issue: This approach is good enough for Lisp to C. But what about callbacks, i.e. C to Lisp? Do you know how a foreign function would react when returned an unexpected stack pointer? gcc -fno-omit-frame-pointer helps around this, but is not general.
Without a hint, one simply doesn't know what calling convention the foreign caller expects. Clean up the stack or not, that is the question.
Regards, Jörg Höhle.