Generating Function Prototypes

Ashley Yakeley ashley at semantic.org
Sun Jul 7 15:18:34 EDT 2002


At 2002-07-07 09:28, Simon Marlow wrote:

>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.  

OK

>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.

Wouldn't it be better if this were simply considered a bug in GHC? Doing 
-fvia-c really shouldn't affect program behaviour IMO, I don't see why 
the compiler can't create its own private prototype when compiling to its 
own private C, that guaranteed to behave the same way compiling directly 
to object code would.

-- 
Ashley Yakeley, Seattle WA




More information about the FFI mailing list