[GHC] #7630: FFI: "capi" calling convention doesn't work

#7630: FFI: "capi" calling convention doesn't work -------------------------+-------------------------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.1 | Keywords: Os: Linux | Architecture: x86 Failure: None/Unknown | Blockedby: Blocking: | Related: -------------------------+-------------------------------------------------- According to [http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/ffi.html#ffi-capi] there is a `capi` calling convention, but ghc disagrees: {{{ % cat capi.hs {-# LANGUAGE ForeignFunctionInterface #-} import Foreign.C foreign import capi "math.h value M_PI" mPI :: CDouble main :: IO () main = print mPI % ghc capi.hs [1 of 1] Compiling Main ( capi.hs, capi.o ) capi.hs:5:16: parse error on input `capi' }}} Is the documentation wrong? -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7630 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7630: FFI: "capi" calling convention doesn't work ---------------------------+------------------------------------------------ Reporter: guest | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: invalid | Keywords: Os: Linux | Architecture: x86 Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ---------------------------+------------------------------------------------ Changes (by simonmar): * status: new => closed * difficulty: => Unknown * resolution: => invalid Comment: You need to add `CAPI` to your `LANGUAGE` pragma. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7630#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7630: FFI: "capi" calling convention doesn't work ----------------------------------------+----------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: | Keywords: Os: Linux | Architecture: x86 Failure: GHC rejects valid program | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- Changes (by guest): * status: closed => new * failure: None/Unknown => GHC rejects valid program * resolution: invalid => Comment: I did but ghc doesn't accept it: {{{ % cat capi.hs {-# LANGUAGE ForeignFunctionInterface, CAPI #-} import Foreign.C foreign import capi "math.h value M_PI" mPI :: CDouble main :: IO () main = print mPI % ghc capi.hs capi.hs:1:40: Unsupported extension: CAPI }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7630#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7630: FFI: "capi" calling convention doesn't work ----------------------------------------+----------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.1 Resolution: | Keywords: Os: Linux | Architecture: x86 Failure: GHC rejects valid program | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- Comment(by thoughtpolice): The docs are wrong. The extension is actually called '''CApiFFI''', and your example works if you use that instead of '''CAPI'''. This should be fixed in the users manual and merged into 7.6.2 I think. I'll fix it in HEAD with this bug as the ticket. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7630#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7630: FFI: "capi" calling convention doesn't work
----------------------------------------+-----------------------------------
Reporter: guest | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.1
Resolution: fixed | Keywords:
Os: Linux | Architecture: x86
Failure: GHC rejects valid program | Difficulty: Unknown
Testcase: | Blockedby:
Blocking: | Related:
----------------------------------------+-----------------------------------
Changes (by thoughtpolice):
* status: new => closed
* resolution: => fixed
Comment:
Nevermind; this was already fixed a while back:
{{{
Author: shelarcy
participants (1)
-
GHC