Ticket #2710 (new bug)

Opened 4 years ago

Last modified 4 months ago

-main-is flag in {-# OPTIONS #-} pragma not fully supported

Reported by: Stephan202 Owned by:
Priority: lowest Milestone: 7.6.1
Component: Compiler Version: 6.8.3
Keywords: -main-is ghc Cc: dterei
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The -main-is flag is dynamic an may therefore be placed inside the {-# OPTIONS #-} pragma. Version 6.8.3 of runghc respects this flag (that is, runghc works as expected), but this cannot be said of ghc.

Example file T.hs

{-# OPTIONS -main-is T.main #-}

module T where

main :: IO ()
main = putStrLn "Hello world"

Example execution

$ ghc --make -o t T.hs
[1 of 1] Compiling T                ( T.hs, T.o )
Warning: output was redirected with -o, but no output will be generated
because there is no Main module.

Additional notes

This bug is related to ticket #1312, but the difference is that ticket #1312 only addressed runghc, not ghc.

Change History

Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to 6.12 branch

Thanks for the report!

Changed 2 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 2 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 18 months ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 15 months ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 12 months ago by dterei

  • cc dterei added
  • failure set to None/Unknown

Changed 12 months ago by Stephan202

  • failure changed from None/Unknown to Incorrect warning at compile-time

This bug is still present in version 6.12.3. I set the type of failure to Incorrect warning at compile-time, though arguably the compiler's output is simply incorrect: it should produce an executable but doesn't.

Changed 12 months ago by dterei

oops sorry, I only meant to add myself to the cc, not change the failure type.

Changed 8 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 4 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1
Note: See TracTickets for help on using tickets.