bogus inlining of foreign import "foo.h &foo"
|Reported by:||simonmar||Owned by:||simonpj|
|Type of failure:||Test Case:|
|Related Tickets:||Differential Rev(s):|
Foreign imports with include file annotations are not supposed to be inlined, because if they end up crossing a module boundary the include file might not be available when compiling the importing module.
This works by making the Id representing the foreign call NOINLINE, which is done in DsForeign.dsCImport. Unfortunately with the example below, the Id still gets inlined into another binding, and thereby escapes the module.
module Curses (screen_size) where import Foreign data WINDOW = WINDOW type WINDOWptr = Ptr WINDOW foreign import ccall unsafe "curses.h & stdscr" stdscrp :: Ptr WINDOWptr screen_size :: IO () screen_size = do stdscr <- peek stdscrp return ()
Compile with GHC 6.8.2, -O.
Change History (9)
comment:5 Changed 8 years ago by igloo
- Milestone changed from 6.8.3 to 6.10 branch
- Priority changed from low to normal