RE: Generating Function Prototypes

2002-07-04 Thread Simon Marlow
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

Re: Generating Function Prototypes

2002-07-04 Thread Malcolm Wallace
Alastair Reid [EMAIL PROTECTED] writes: foreign import foo :: Float - Char extern HsChar ffi_generated_foo(HsChar arg1); Errm, shouldn't that be: extern HsChar ffi_generated_foo(HsFloat arg1); ^^^ ?? Or is there some other

Re: Generating Function Prototypes

2002-07-04 Thread Ashley Yakeley
At 2002-07-04 03:55, Alastair Reid wrote: I still think we're better off removing header files completely and having the Haskell type completely determine the calling convention employed. I agree. The Haskell compiler doesn't necessarily need to spit out its own prototypes for the benefit of

Re: Generating Function Prototypes

2002-07-04 Thread Alastair Reid
Errm, shouldn't that be: [...] Or is there some other trick involved here? Sorry, yes it should - just me getting confused in translating between Haskell's f :: A - B and C's B f(A); A ___ FFI mailing list [EMAIL PROTECTED]

RE: Generating Function Prototypes

2002-07-04 Thread Simon Marlow
I just reread that section and can't see anything that contradicts the idea that the FFI implementation ignores any header files provided. For example, the phrase: implements calls to C functions ... as if a function prototype for the called functions is in scope can be interpreted