
On 25 April 2006 10:48, Duncan Coutts wrote:
One downside would be that we would only be able to call C functions which conform to the standard platform ABI. As it is at the moment (perhaps somewhat by accident) we can call C functions that have non-standard ABI annotations in their prototype, eg:
int foo (int) __attribute__((regparam(3)))
ok that's a silly example, bu there are more sensible examples of ABI weirdness - especially on arches like mips which seem to support half a dozen different ABIs. Perhaps we don't care, I'm not sure I do.
The FFI declaration is supposed to specify the ABI completely, so these differences should be reflected in the FFI syntax. As you say it works by accident now - but only when compiling via C, when using the NCG it'll go wrong. Cheers, SImon