[GHC] #10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’"

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" -----------------------------------------+--------------------------------- Reporter: phischu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -----------------------------------------+--------------------------------- Consider the following three files: {{{#!hs -- A.hs module A where }}} {{{#!hs -- A.hs-boot module A where }}} {{{#!hs -- B.hs module B where import {-# SOURCE #-} A }}} When compiling these three files GHC emits a warning and rightly so: {{{
ghc B.hs
B.hs:3:23: Warning: {-# SOURCE #-} unnecessary in import of ‘A’ [1 of 3] Compiling A[boot] ( A.hs-boot, A.o-boot ) [2 of 3] Compiling A ( A.hs, A.o ) [3 of 3] Compiling B ( B.hs, B.o ) }}} When on the other hand compiling with `-w` I expect the warning to go away but it doesn't. {{{
ghc -w B.hs
B.hs:3:23: Warning: {-# SOURCE #-} unnecessary in import of ‘A’ [1 of 3] Compiling A[boot] ( A.hs-boot, A.o-boot ) [2 of 3] Compiling A ( A.hs, A.o ) [3 of 3] Compiling B ( B.hs, B.o ) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" ---------------------------------+----------------------------------------- Reporter: phischu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by simonpj): Good catch! Currently -w simply makes the "set of active warning flags" empty. But in fact there is no flag to control this particular warning (see `DynFlags.WarningFlag`). So we must choose: * Invent a new flag `-fwarn-unnecesary-source-imports", or * Re-use an existing flag, such as `-fwarn-unused-imports`. I'm inclined to do the latter; it's hardly a hot topic. Then * Modify `GhcMake.warnUnnecessarySourceImports` to check this flag, and do nothing unless it is set. This is easy. Would someone like to do it? Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" ---------------------------------+----------------------------------------- Reporter: phischu | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Changes (by thomie): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" ---------------------------------+----------------------------------------- Reporter: phischu | Owner: rpglover64 Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Changes (by mpickering): * owner: => rpglover64 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" ---------------------------------+----------------------------------------- Reporter: phischu | Owner: rpglover64 Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: | Keywords: newcomer Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: D1157 ---------------------------------+----------------------------------------- Changes (by rpglover64): * differential: => D1157 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’"
---------------------------------+-----------------------------------------
Reporter: phischu | Owner: rpglover64
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.1
Resolution: | Keywords: newcomer
Operating System: Linux | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: D1157
---------------------------------+-----------------------------------------
Comment (by Thomas Miedema

#10637: Cannot suppress "Warning: {-# SOURCE #-} unnecessary in import of ‘A’" -------------------------------------+------------------------------------- Reporter: phischu | Owner: rpglover64 Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | warnings/should_compile/T10637/T10637 Blocked By: | Blocking: Related Tickets: | Differential Revisions: D1157 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * os: Linux => Unknown/Multiple * testcase: => warnings/should_compile/T10637/T10637 * architecture: x86_64 (amd64) => Unknown/Multiple * milestone: => 7.12.1 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10637#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC