Opened 3 years ago

Closed 3 years ago

#10360 closed bug (invalid)

GHC ignores command-line options if *.o and *.hi files exist

Reported by: asr Owned by:
Priority: low Milestone:
Component: Compiler Version: 7.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by asr)

For example, given the module

module Test where

foo = putStrLn "Hello World"

if I compile using the command

ghc -c Test.hs

and then I compile adding the -Wall flag

ghc -c -Wall Test.hs

I would expect the warning

Test.hs:3:1: Warning:
    Top-level binding with no type signature: foo :: IO ()

but GHC produces the message

compilation IS NOT required

That is, the -Wall flag was ignored because the Test.o and Test.hi exist.

(I couldn't reproduce this behaviour using GCC (the GNU Compiler Collection) version 4.6.3.)

Change History (5)

comment:1 Changed 3 years ago by asr

Description: modified (diff)

comment:2 Changed 3 years ago by asr

Description: modified (diff)

comment:3 Changed 3 years ago by archblob

You can find more details about why things are the way they are and how to force recompilation in the user guide Maybe change this to a feature request ?

Last edited 3 years ago by archblob (previous) (diff)

comment:4 Changed 3 years ago by archblob

Priority: normallow

comment:5 Changed 3 years ago by asr

Resolution: invalid
Status: newclosed

The documentation pointed out in comment:3 is clear. Thanks! I'm closing the ticket.

Note: See TracTickets for help on using tickets.