Ticket #5610 (new feature request)
Improve "Unacceptable argument type in foreign declaration" error message
| Reported by: | bgamari | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 7.4.1 |
| Component: | Compiler (Type checker) | Version: | 7.6.1-rc1 |
| Keywords: | Cc: | ghc@…, bos@…, malaquias@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Incorrect warning at compile-time | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Using ghc 1ece7b27a11c6947f0ae3a11703e22b7065a6b6c, zlib fails to build,
$ cabal install zlib
Resolving dependencies...
Configuring zlib-0.5.3.1...
Preprocessing library zlib-0.5.3.1...
Building zlib-0.5.3.1...
[1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist/build/Codec/Compression/Zlib/Stream.hs, dist/build/Codec/Compression/Zlib/Stream.o )
Codec/Compression/Zlib/Stream.hsc:857:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h inflateInit2_" c_inflateInit2_
:: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:857:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h inflateInit2_" c_inflateInit2_
:: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:857:1:
Unacceptable result type in foreign declaration: IO CInt
Safe Haskell is on, all FFI imports must be in the IO monad
When checking declaration:
foreign import ccall unsafe "static zlib.h inflateInit2_" c_inflateInit2_
:: StreamState -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:865:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h inflate" c_inflate
:: StreamState -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:865:1:
Unacceptable result type in foreign declaration: IO CInt
Safe Haskell is on, all FFI imports must be in the IO monad
When checking declaration:
foreign import ccall unsafe "static zlib.h inflate" c_inflate
:: StreamState -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:872:1:
Unacceptable result type in foreign declaration: IO CInt
Safe Haskell is on, all FFI imports must be in the IO monad
When checking declaration:
foreign import ccall unsafe "static zlib.h deflateInit2_" c_deflateInit2_
:: StreamState
-> CInt
-> CInt -> CInt -> CInt -> CInt -> Ptr CChar -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:884:1:
Unacceptable argument type in foreign declaration: CInt
When checking declaration:
foreign import ccall unsafe "static zlib.h deflate" c_deflate
:: StreamState -> CInt -> IO CInt
Codec/Compression/Zlib/Stream.hsc:884:1:
Unacceptable result type in foreign declaration: IO CInt
Safe Haskell is on, all FFI imports must be in the IO monad
When checking declaration:
foreign import ccall unsafe "static zlib.h deflate" c_deflate
:: StreamState -> CInt -> IO CInt
cabal: Error: some packages failed to install:
zlib-0.5.3.1 failed during the building phase. The exception was:
ExitFailure 1
Change History
Note: See
TracTickets for help on using
tickets.
