Make unrecognised `-W` flags a warning rather than an error
Currently, it's a fatal error to pass GHC a warning flag it doesn't recognise:
$ ghc-8.1.20160111 -Wfoobar -c foobar.hs ghc: unrecognised flag: -Wfoobar Usage: For basic information, try the `--help' option.
However, in order to gain more flexibility adding/removing warning flags without requiring users to carefully guard which flags a given GHC version supports, it was suggested to make GHC more tolerating in case of unrecognised warning flags (which may either have been removed, or not yet available in the current GHC version).
Specifically, I propose the following:
-W<token>for an unknown
<token>as a warning rather than an error
- This warning gets its own token
unrecognised-warning-flag(turned on by default), so that it can be controlled via the general warning facilities as well:
-Wno-unrecognised-warning-flagturns off such warnings
-Wunrecognised-warning-flagturns on such warnings explicitly
-Werror=unrecognised-warning-flag(once we have #11219 (closed)) emulates the old behaviour
- various other combinations with warning-sets,
|CC||bgamari, ekmett, quchen|