Fergus Henderson <[EMAIL PROTECTED]> wrote,

> On 02-Jan-2001, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote:
> > 
> > and even the ability to cast between data pointers and function pointers
> > is described as a common non-standard extension in ISO/ANSI C99.
> 
> That's true. ANSI/ISO C does not guarantee that a data pointer will
> fit in a function pointer or vice versa.
> 
> If you want something that could be either a data pointer or
> a function pointer, you need to use a union:
> 
>       union {
>               void *data;
>               void (*func)(void);
>       }

This means that we should not provide

    castFunPtrToPtr :: FunPtr a -> Ptr b
    castPtrToFunPtr :: Ptr a -> FunPtr b

Has anybody ever used these casts?  As long as `FunPtr' is
used for f.e.d., I don't see much use in these casts.  It
certainly doesn't make much sense to peek and poke an
address produced by f.e.d.

So, I propose to drop these two casts.  Objections?

Cheers,
Manuel

_______________________________________________
FFI mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/ffi

Reply via email to