Skip to content

Emit warnings when conflicting flags are supplied

Many command line flags can be thought of as modifying some GHC's internal flag state. We do this so that we can override flags in one place by re-specifying the flag later, e.g. ghc -fno-new-codegen ... -fnew-codegen

While this is handy, it can cause some interesting unexpected behavior where a user modifies a flag in some place (for example, the command line), and the flag gets subsequently overridden by another location (for example, an OPTIONS_GHC pragma). What would be useful is if GHC could report when some internal option is modified by multiple places, and say which one "won" in the end.

Trac metadata
Trac field Value
Version 7.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information