Generating Function Prototypes

Simon Marlow simonmar at microsoft.com
Sun Jul 7 12:28:11 EDT 2002


> At 2002-07-05 01:17, Simon Marlow wrote:
> 
> >> If specifying a header file with a function prototype is allowed to
> >> affect the generated code (i.e., the calling convention), 
> then it is
> >> clear that the Haskell type does not completely determine 
> the calling
> >> convention. 
> >
> >I claim that it is not.
> 
> Well it does anyway, as my IO Int64 example shows.

No it doesn't ;-)

Your example works fine when compiled with the native code generator.  I
explained (in my previous message) that GHC needs header files and
prototypes in order to generate correct foreign calls when compiling via
C.  This is, IMO, a GHC-specific issue and doesn't have anything to do
with the FFI specification - although confusion could be avoided if the
spec pointed out that some implementations might need access to header
files/prototypes in order to compile the code.

Cheers,
	Simon



More information about the FFI mailing list