警告:在FFI声明中使用newtype`CInt',

时间:2012-06-20 03:05:09

标签: haskell ffi

使用ghc 7.4.2构建gtk2hs-buildtools时,我收到以下警告:

c2hs/toplevel/C2HSConfig.hs:110:1:
    Warning: newtype `CInt' is used in an FFI declaration,
             but its constructor is not in scope.
             This will become an error in GHC 7.6.1.
    When checking declaration:
      foreign import ccall safe "static bitfield_direction" bitfield_direction
        :: CInt

即使我有import Foreign.C.Types(CInt),我也会收到与FFI通话类似的警告。

摆脱这种警告的正确方法是什么?

1 个答案:

答案 0 :(得分:5)

import Foreign.C.Types(CInt(..))

获取构造函数。

相关问题