[GHC] #11000: Implement `-Wcompat`

GHC ghc-devs at haskell.org
Thu Oct 22 11:15:42 UTC 2015


#11000: Implement `-Wcompat`
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:  Design/Warnings   |
-------------------------------------+-------------------------------------
Description changed by hvr:

Old description:

> Currently we have only the following generic warning "levels":
>
> {{{
>    -W     enable normal warnings
>    -w     disable all warnings
>    -Wall  enable almost all warnings (details in )
> }}}
>
> It would be useful to be able to refer collectively to all currently
> implemented forward-compatibility warnings (e.g. about upcoming changes
> in `base`, like `-fwarn-amp`) via a symbolic `-Wcompat` flag.
>
> This way, users have more flexibility in opt-in or out of such warnings.
> So e.g. the following settings are possible in `.cabal` files:
>
>   `ghc-options: -Wall` :: enable "almost all warnings" as before. Some
> compat warnings maybe part of `-Wall`, some won't (yet).
>   `ghc-options: -Wall -Wcompat` :: enable "almost all warnings" as well
> as all implemented warnings. E.g. if GHC 8.0 implements `-fwarn-mfp-
> compat` but doesn't include it in `-Wall`, this allows users to get
> notified asap about warnings to opt into that
>   `ghc-options: -Wall -Wno-compat` :: This enables `-Wall` **minus** any
> future-compat warnings. This is for users who want to be warned at all
> about any future compat warnings.
>   `ghc-options: -Wcompat` :: Of course, `-W(no-)compat` can be used also
> w/o `-Wall`, and then is equivalent to turning on/off the respective
> individual `-fwarn-*-compat` flags.

New description:

 Currently we have only the following generic warning "levels":

 {{{
    -W     enable normal warnings
    -w     disable all warnings
    -Wall  enable almost all warnings (details in )
 }}}

 It would be useful to be able to refer collectively to all currently
 implemented forward-compatibility warnings (e.g. about upcoming changes in
 `base`, like `-fwarn-amp`) via a symbolic `-Wcompat` flag.

 This way, users have more flexibility in opt-in or out of such warnings.
 So e.g. the following settings are possible in `.cabal` files:

   `ghc-options: -Wall` :: enable "almost all warnings" as before. Some
 compatibility warnings may be part of `-Wall`, some won't (yet).
   `ghc-options: -Wall -Wcompat` :: enable "almost all warnings" as well as
 all currently implemented warnings. E.g. if GHC 8.0 implements `-fwarn-
 mfp-compat` but doesn't include it in `-Wall`, this gives users a way to
 opt in to get notified early about upcoming changes.
   `ghc-options: -Wall -Wno-compat` :: This enables `-Wall` **minus** any
 future-compat warnings. This is for users who want to be warned at all
 about any future compat warnings.
   `ghc-options: -Wcompat` :: Of course, `-W(no-)compat` can be used also
 w/o `-Wall`, and then is equivalent to turning on/off the respective
 individual `-fwarn-*-compat` flags.
   `ghc-options: -Wall -Wcompat -Wno-mfp-compat` :: This would allow to
 acknowledge the MFP compat warnings, while enabling other future GHC
 compat warnings.

--

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


More information about the ghc-tickets mailing list