Ticket #1386 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

foreign exports not taken into account when calculating -fwarn-unused-imports

Reported by: duncan Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: rn058 Blocked By:
Blocking: Related Tickets:

Description

Here we have a program that imports and uses liftM from Control.Monad, but only as a result of being used in the definition of a function that is foreign exported.

module Foo () where

import Control.Monad (liftM)

foo :: IO ()
foo = id `liftM` return ()

foreign export ccall "hs_foo"
  foo :: IO ()

GHC 6.6 and HEAD report:

foo.hs:3:0:
    Warning: Module `Control.Monad' is imported, but nothing from it is used,
               except perhaps instances visible in `Control.Monad'
             To suppress this warning, use: import Control.Monad()

So I suppose all that needs to happen is to add in foreign exports as roots when building the usage graph.

Change History

Changed 6 years ago by simonpj

  • status changed from new to closed
  • testcase set to rn058
  • resolution set to fixed

Fixed thank you.

Simon

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.