
#8650: Unexpected behaviour of import ccall "header.h function" -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: Documentation bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by thomie): From Section 8.5.1 of the report (emphasis mine):
The ''optional'' filename `chname` specifies a C header file, where the intended meaning is that the header file declares the C entity identified by `cid`.
C functions are normally declared using prototypes in a C header file. Earlier versions of GHC (6.8.3 and earlier) #included the header file in
GHC no longer includes external header files when compiling via C, so
From the GHC [https://www.haskell.org/ghc/docs/7.8.3/html/users_guide/ffi- ghc.html#glasgow-foreign-headers user's guide]: the C source file generated from the Haskell code, and the C compiler could therefore check that the C function being called via the FFI was being called at the right type. this checking is not performed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8650#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler