Re: Ptr and ForeignPtr Questions

23 Sep
2001
23 Sep
'01
7:07 p.m.
At 2001-09-23 15:56, Marcin 'Qrczak' Kowalczyk wrote:
But do you have an example of a Haskell type for a foreign import function, for which the corresponding C function type would be ambiguous?
Ptr CChar (as an argument). It could be either char * or const char *.
It's always char*. A Haskell function passed a Ptr CChar is not prevented from modifying the contents of the pointer simply due to its type-declaration. In C, a char* can be implicitly converted to a const char* where necessary (but not the other way around). -- Ashley Yakeley, Seattle WA
8641
Age (days ago)
8641
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ashley Yakeley