[MLton] MLton broken FFI on AMD64???
Henry Cejtin
henry.cejtin at sbcglobal.net
Fri Feb 4 07:55:37 PST 2011
I had seen the clear of eax in the gcc code for printf but didn't find
the ABI item you found. I guess that in the case that there is no C
prototype, the C compiler has to set that %eax `correctly' just in case
the function is varargs.
Perhaps the safe thing to do is to add an attribute to mean `definitely
NOT varargs', and to always set %eax unless that attribute is present.
Ugly, but upward compatible. More importantly, it's pretty easy to miss
the perhaps even undocumented fact that a function CAN take a variable
number of args. YUCK.
Very quick detective work Wesley, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton/attachments/20110204/fca56b2d/attachment.html
More information about the MLton
mailing list