Generating Function Prototypes

Ashley Yakeley ashley at
Mon Jul 8 06:07:55 EDT 2002

At 2002-07-08 02:14, Simon Marlow wrote:

>Sure, it's a problem, a bug in GHC, whatever.  But I don't see a way
>around it!  We can't just generate prototypes because they might
>conflict with prototypes already in scope.

I see the problem now.

This seems to compile (with a warning):

    typedef long long HsInt64;

    int foo (int); // annoying decl we want to ignore

    // foo :: Int64 -> IO Int64
    inline HsInt64 call_foo (HsInt64 x)
        static HsInt64 foo(HsInt64);
        return foo(x);

I haven't actually tested it, but it may be a solution.

Ashley Yakeley, Seattle WA

More information about the FFI mailing list