Generating Function Prototypes
Ashley Yakeley
ashley at semantic.org
Wed Jul 3 18:48:12 EDT 2002
At 2002-07-03 09:23, Simon Marlow wrote:
>> Of course, this ignores the detail that while the C compilers are
>> generating correct code, they may also be generating warnings about
>> alleged type errors - which can be a bit disconcerting.
>
>It is an error, not just a warning, if the prototypes don't match. GCC
>will complain loudly if there's a missing 'const' - it won't generate
>any code at all.
For 'foreign import' this won't happen, will it? The Haskell compiler can
generate its own prototype as well as the call to the function. The only
thing that matters is that the calling conventions for const and
non-const pointers are the same...
--
Ashley Yakeley, Seattle WA
More information about the FFI
mailing list