Skip to content

Parse fails when foreign import declarations contain path information (like those generated by c2hs).

An import declaration like:

foreign import ccall safe "path/to/test.h test" test :: IO ()

fails with:

test.hs:7:26: Malformed entity string

I've marked this as a major issue because it ought to affect, for instance, any library that depends on c2hs (which generates bindings of this kind).

I'm not sure if this is a GHC regression or actually an improvement in fidelity to the FFI spec (although I didn't see anything in the spec that would preclude qualifying the header name with path info).

Trac metadata
Trac field Value
Version 6.12.1 RC1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information