#2897: HsFFI.h is not in the default include path for hsc2hs
---------------------------+------------------------------------------------
  Reporter:  cjs           |          Owner:                  
      Type:  bug           |         Status:  new             
  Priority:  highest       |      Milestone:  7.4.1           
 Component:  hsc2hs        |        Version:  6.10.1          
Resolution:                |       Keywords:                  
  Testcase:                |      Blockedby:                  
Difficulty:  Unknown       |             Os:  Unknown/Multiple
  Blocking:                |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown  |  
---------------------------+------------------------------------------------

Comment(by simonmar):

 There's another solution:

  * Have `hsc2hs` emit two C files, one that looks like the current one,
 and another one that defines simple wrappers for the C library functions
 that we call (`fprintf` etc.)

  * `template-hsc.h` declares prototypes for the wrappers, and defines its
 own macros in terms of them.  It does not need to `#include` any system
 headers.

  * `hsc2hs` will have to compile both C files and link them together into
 the final program.

 So then because we're not including any system headers in `template-
 hsc.h`, the problem should go away.

 Even if we adopt Duncan's proposal, I think we should do this too, because
 including system headers in the same C file that generates the `.hs`
 output has the potential to create other subtle problems too.  By avoiding
 doing this we give the user full control over what headers are included
 and in what order.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2897#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to