Re: MLton broken FFI on AMD64???
Henry Cejtin <[email protected]>
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <[email protected]> |
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. _______________________________________________ MLton mailing list [email protected] http://mlton.org/mailman/listinfo/mlton