Reconsidering -Wall and -Wcompat

Herbert Valerio Riedel hvriedel at gmail.com
Mon Feb 15 10:43:02 UTC 2016


On 2016-02-14 at 19:51:19 +0100, Sven Panne wrote:

[...]

> As stated on the Wiki, stuff in -Wcompat will often be non-actionable,
> so the only option I see if -Wcompat is included in -Wall will be
> -Wno-compat for all my projects.

This depends on what we mean by "actionable". I'm not sure I'd consider
the current -Wcompat warnings to be "non-actionable".

For instance, `aeson-0.11` happens to be free of

  -Wall -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances

warnings, which didn't require any CPP, see e.g.

 - https://github.com/bos/aeson/pull/337/files
 - https://github.com/bos/aeson/pull/338/files


Also, as an example for a larger code-base, {Cabal,cabal-install} HEAD
in Git aspire to be warning-free as well[1]; so depending on your definition,
-Wcompat *is* actionable.

> -Wcompat would be restricted to a few manual local builds to see where
> things are heading.



 [1]: See  .e.g. https://github.com/haskell/cabal/blob/master/Cabal/Cabal.cabal#L191-L193

         if impl(ghc >= 8.0)
            ghc-options: -Wcompat -Wnoncanonical-monad-instances
                         -Wnoncanonical-monadfail-instances

      and the Travis job enables -Werror


More information about the Glasgow-haskell-users mailing list