Ticket #3742 (closed merge: fixed)
redundant space in FFI imports rejected by 6.12
|Reported by:||duncan||Owned by:||igloo|
|Component:||Compiler (Parser)||Version:||6.12.1 RC1|
|Type of failure:||GHC rejects valid program||Difficulty:|
|Test Case:||Blocked By:|
GHC 6.10 and older accepted this code:
foreign import ccall unsafe " g_get_application_name" g_get_application_name :: (IO (Ptr CChar))
GHC 6.12 now rejects it with
glib/System/Glib/Utils.chs:81:28: Malformed entity string
The problem is the leading space in the C entity string. This code is generated by c2hs which is doing header ++ " " ++ ident however the header may be empty.
We should probably allow this code, though possibly with a warning. In parallel, c2hs could be fixed so it doesn't do that.