[GHC] #10895: "no output will be generated" should be an error, not a warning.

GHC ghc-devs at haskell.org
Fri Sep 18 18:36:55 UTC 2015


#10895: "no output will be generated" should  be an error, not a warning.
-------------------------------------+-------------------------------------
        Reporter:  gershomb          |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------
Description changed by gershomb:

Old description:

> Consider a file "Test.hs" which has a "main" function but is declared as
> "module Test where..."
>
> If we attempt to compile it, we get the following warning:
>
> {{{
> Warning: output was redirected with -o, but no output will be generated
> because there is no Main module.
> }}}
>
> This should be upgraded from a warning to an error. This would help e.g.
> Cabal, because such warnings do not lead to a failure of the wrapping
> Cabal process, which is confusing to end-users.
>
> For gory details, see e.g. discussion at
> https://github.com/haskell/cabal/issues/1847

New description:

 Consider a file "Test.hs" which has a "main" function but is declared as
 "module Test where..."

 If we attempt to compile it with for example "ghc --make Test.hs -o Test",
 we get the following warning:

 {{{
 Warning: output was redirected with -o, but no output will be generated
 because there is no Main module.
 }}}

 This should be upgraded from a warning to an error. This would help e.g.
 Cabal, because such warnings do not lead to a failure of the wrapping
 Cabal process, which is confusing to end-users.

 For gory details, see e.g. discussion at
 https://github.com/haskell/cabal/issues/1847

--

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


More information about the ghc-tickets mailing list