[Haddock] [haddock] #194: Stricter than GHC about newtypes in FFI code

haddock haddock at projects.haskell.org
Mon Feb 13 21:33:08 GMT 2012


#194: Stricter than GHC about newtypes in FFI code
--------------------+-------------------------------------------------------
Reporter:  nomeata  |       Owner:        
    Type:  defect   |      Status:  new   
Priority:  major    |   Milestone:  2.10.0
 Version:  2.9.4    |    Keywords:        
--------------------+-------------------------------------------------------
 Hi,

 this is Haddock version 2.10.0 as shipped with GHC 7.4.1. The package
 GLUT-2.1.2.1 contains FFI code that GHC warns about, but haddock fails:

 {{{
 [ 9 of 21] Compiling Graphics.UI.GLUT.Window ( Graphics/UI/GLUT/Window.hs,
 dist-ghc/build/Graphics/UI/GLUT/Window.o )

 Graphics/UI/GLUT/Window.hs:113:1:
     Warning: newtype `Window' 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 unsafe "static glutCreateWindow"
 glutCreateWindow
         :: CString -> IO Window
 }}}
 vs.
 {{{
 Running Haddock for GLUT-2.1.2.1...
 Running hscolour for GLUT-2.1.2.1...
 Preprocessing library GLUT-2.1.2.1...
 Warning: The documentation for the following packages are not installed.
 No
 links will be generated to these packages: rts-1.0
 Preprocessing library GLUT-2.1.2.1...
 [..]
 Graphics/UI/GLUT/Window.hs:113:1:
     Unacceptable result type in foreign declaration: IO Window
     When checking declaration:
       foreign import ccall unsafe "static glutCreateWindow"
 glutCreateWindow
         :: CString -> IO Window
 }}}

 But something is fishy, the {{{[..]}}} part contains a few of the
 {{{Warning: newtype `CInt' is used in an FFI declaration,}}} warnings, so
 maybe something else is amiss here.

-- 
Ticket URL: <http://trac.haskell.org/haddock/ticket/194>
haddock <http://www.haskell.org/haddock>
Haddock, The Haskell Documentation Tool


More information about the Haddock mailing list