Skip to content

redundant space in FFI imports rejected by 6.12

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.

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