使用CAPI调用约定时的GCC警告

时间:2013-04-07 06:52:58

标签: haskell ghc ffi

使用这样的CAPI时:

// libvlc.h
libvlc_instance_t *libvlc_new (int argc, const char *const *argv)

// VLC.hs
foreign import capi "vlc/libvlc.h libvlc_new" vlcNew :: CInt -> Ptr CString -> IO (Ptr Libvlc)

我收到了警告

/tmp/ghc3011_0/ghc3011_0.c: In function ‘ghc_wrapper_d18b_libvlc_new’:

/tmp/ghc3011_0/ghc3011_0.c:10:1:
     warning: passing argument 2 of ‘libvlc_new’ from incompatible pointer type [enabled by default]

In file included from /tmp/ghc3011_0/ghc3011_0.c:7:0: 

/usr/include/vlc/libvlc.h:138:1:
     note: expected ‘const char * const*’ but argument is of type ‘HsInt8 **’

使用ccall时干净利落地编译。

似乎很好,但它仍然是一个警告。我有什么可以做的吗?

0 个答案:

没有答案
相关问题