You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Unacceptable argument type in foreign declaration:
‘()’ cannot be marshalled in a foreign call
• When checking declaration:
foreign import ccall safe "wrapper" inline_c_ffi_6989586621681841573
:: (() -> IO ()) -> IO (FunPtr (() -> IO ()))
Inspecting the FunPtr docs, I see that this is not the expected type for a function pointer of type void (*)(void) instead it should have type IO () or (). The bug is in buildArr in the antiquoter for $fun:. I'm working on a fix and will make a PR shortly.
The text was updated successfully, but these errors were encountered:
lehmacdj
changed the title
Handle void arguments correctly
C types with void explicitly in the parameter list (e.g. void (*)(void)) are assigned the wrong Haskell type
Feb 5, 2025
As a workaround you can declare the type without a parameter list, e.g. void (*)() for a void (*)(void) function. This is the correct C++ syntax but technically incorrect for C.
When attempting to invoke a function with a void argument like in this snippet:
I get an error like so:
Inspecting the
FunPtr
docs, I see that this is not the expected type for a function pointer of typevoid (*)(void)
instead it should have typeIO ()
or()
. The bug is in buildArr in the antiquoter for$fun:
. I'm working on a fix and will make a PR shortly.The text was updated successfully, but these errors were encountered: