[Git][ghc/ghc][wip/amg/warning-categories] Allow WARNING pragmas to be controlled with custom categories

Adam Gundry (@adamgundry) gitlab at gitlab.haskell.org
Tue Jan 17 08:57:41 UTC 2023



Adam Gundry pushed to branch wip/amg/warning-categories at Glasgow Haskell Compiler / GHC


Commits:
294cf378 by Adam Gundry at 2023-01-17T08:57:26+00:00
Allow WARNING pragmas to be controlled with custom categories

Closes #17209. This implements GHC Proposal 541, allowing a WARNING
pragma to be annotated with a category like so:

    {-# WARNING {x-partial} head "This function is undefined on empty lists." #-}

The user can then enable, disable and set the severity of such warnings
using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on.  There
is a new warning group `-Wextended-warnings` containing all these warnings.
Warnings without a category are treated as if the category was `deprecations`,
and are (still) controlled by the flags `-Wdeprecations`
and `-Wwarnings-deprecations`.

- - - - -


30 changed files:

- compiler/GHC/Driver/Config/Diagnostic.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Unit/Module/Warnings.hs
- compiler/GHC/Utils/Error.hs
- docs/users_guide/9.6.1-notes.rst
- docs/users_guide/exts/pragmas.rst
- docs/users_guide/using-warnings.rst
- testsuite/tests/parser/should_compile/T3303.stderr
- testsuite/tests/rename/should_compile/T5867.stderr
- testsuite/tests/rename/should_compile/rn050.stderr
- testsuite/tests/rename/should_compile/rn066.stderr
- testsuite/tests/rename/should_fail/T5281.stderr
- testsuite/tests/warnings/should_compile/DeprU.stderr
- + testsuite/tests/warnings/should_fail/WarningCategory1.hs
- + testsuite/tests/warnings/should_fail/WarningCategory1.stderr
- + testsuite/tests/warnings/should_fail/WarningCategory1_B.hs
- + testsuite/tests/warnings/should_fail/WarningCategory2.stderr
- + testsuite/tests/warnings/should_fail/WarningCategory4.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/294cf3781eef40635ef1d60d1fe7199e505acee1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/294cf3781eef40635ef1d60d1fe7199e505acee1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230117/c326cf15/attachment.html>


More information about the ghc-commits mailing list