[Haskell-cafe] Haskell FFI Question

ye yan haskell.ye.yan at gmail.com
Sat Sep 20 07:47:53 UTC 2014


Sorry, accidentally clicked post;

in haskell FFI  c++ side

    Blob db;

    try {
        sb.update(src, src_len);
    } catch (Magick::Exception &error) {
//do something with error
}    


if I compile my program in to c++ program this code works perfectly fine. 
The exception can be handled correctly. But if link this piece of code into 
haskell (main is in haskell side), the exception handle code will never be 
triggered. However if I change the code to 

   Blob db;

    try {
        sb.update(src, src_len);
    } catch (...) {
//can  really do any thing but tell user this function failed
}    

the exception handle part can be triggered in this way. My question is : 
how can I catch exception without using (...) in Haskell FFI?



On Friday, September 19, 2014 2:02:29 PM UTC+9:30, ye yan wrote:
>
> I have been play around with Haskell FFI. My question is for ByteString 
> (Strict) is there a trailing null append to it when pass to it C functions?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140920/31104068/attachment.html>


More information about the Haskell-Cafe mailing list