summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Abel <andreas.abel@ifi.lmu.de>2021-07-26 00:04:37 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-27 12:04:12 -0400
commit0b4033197c7f98aaf772025d7900ac3f9f8d958f (patch)
treef85adae5335aeb2c13ba789720ffc6498febc43a
parentebcdf3fa6e94127e95d0fce75a36989e0e2bf7ee (diff)
downloadhaskell-0b4033197c7f98aaf772025d7900ac3f9f8d958f.tar.gz
Issue #18087: :since: for warnings of ghc 6/7/8
Added :since: fields to users_guide on warning, for warnings introduced starting GHC 6.0. The data was extracted from the HTML docs on warnings, see https://gitlab.haskell.org/ghc/ghc/-/issues/18087 and partially verified by consulting the change logs.
-rw-r--r--docs/users_guide/using-warnings.rst113
1 files changed, 113 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index ce809c348b..79569db675 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -20,6 +20,8 @@ To reverse ``-Werror``, which makes all warnings into errors, use ``-Wwarn``.
:type: dynamic
:category:
+ :since: 8.0
+
By default, you get a standard set of warnings which are
generally likely to indicate bugs in your program. These are:
@@ -121,6 +123,8 @@ The following flags are simple ways to select standard "packages" of warnings:
:type: dynamic
:category:
+ :since: 8.0
+
Turns on every single warning supported by the compiler.
.. ghc-flag:: -Wcompat
@@ -130,6 +134,8 @@ The following flags are simple ways to select standard "packages" of warnings:
:reverse: -Wno-compat
:category:
+ :since: 8.0
+
Turns on warnings that will be enabled by default in the future, but remain
off in normal compilations for the time being. This allows library authors
eager to make their code future compatible to adapt to new features before
@@ -176,6 +182,8 @@ to abort.
:reverse: -Wwarn
:category:
+ :since: 6.8 (``-Wwarn``)
+
Makes any warning into a fatal error. Useful so that you don't miss
warnings when doing batch compilation. To reverse ``-Werror`` and stop
treating any warnings as errors use ``-Wwarn``, or use ``-Wwarn=<wflag>``
@@ -247,6 +255,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unrecognised-warning-flags
:category:
+ :since: 8.0
+
:default: on
Enables warnings when the compiler encounters a ``-W...`` flag that is not
@@ -259,6 +269,8 @@ of ``-W(no-)*``.
:reverse: -Wno-compat-unqualified-imports
:category:
+ :since: 8.10
+
Warns on qualified imports of core library modules which are subject to
change in future GHC releases. Currently there are no modules
covered by this warning.
@@ -284,6 +296,8 @@ of ``-W(no-)*``.
:reverse: -Wno-typed-holes
:category:
+ :since: 7.8
+
:default: on
Determines whether the compiler reports typed holes warnings. Has no
@@ -298,6 +312,8 @@ of ``-W(no-)*``.
:reverse: -Wno-deferred-type-errors
:category:
+ :since: 8.4
+
Causes a warning to be reported when a type error is deferred until
runtime. See :ref:`defer-type-errors`
@@ -347,6 +363,8 @@ of ``-W(no-)*``.
:reverse: -fno-defer-out-of-scope-variables
:category:
+ :since: 8.0
+
Defer variable out-of-scope errors (errors about names without a leading underscore)
until runtime. This will turn variable-out-of-scope errors into warnings.
Using a value that depends on an out-of-scope variable produces a runtime error,
@@ -374,6 +392,8 @@ of ``-W(no-)*``.
:reverse: -Wno-partial-type-signatures
:category:
+ :since: 7.10
+
Determines whether the compiler reports holes in partial type
signatures as warnings. Has no effect unless
:extension:`PartialTypeSignatures` is enabled, which controls whether
@@ -399,6 +419,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unrecognised-pragmas
:category:
+ :since: 6.10
+
Causes a warning to be emitted when a pragma that GHC doesn't
recognise is used. As well as pragmas that GHC itself uses, GHC also
recognises pragmas known to be used by other tools, e.g.
@@ -413,6 +435,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missed-specialisations
:category:
+ :since: 8.0
+
Emits a warning if GHC cannot specialise an overloaded function, usually
because the function needs an ``INLINABLE`` pragma. Reports when the
situation arises during specialisation of an imported function.
@@ -440,6 +464,8 @@ of ``-W(no-)*``.
:reverse: -Wno-all-missed-specialisations
:category:
+ :since: 8.0
+
Emits a warning if GHC cannot specialise an overloaded function, usually
because the function needs an ``INLINABLE`` pragma. Reports
all such situations.
@@ -463,6 +489,8 @@ of ``-W(no-)*``.
:reverse: -Wno-warnings-deprecations
:category:
+ :since: 6.10
+
.. index::
pair: deprecations; warnings
@@ -498,6 +526,8 @@ of ``-W(no-)*``.
:reverse: -Wno-noncanonical-monad-instances
:category:
+ :since: 8.0
+
Warn if noncanonical ``Applicative`` or ``Monad`` instances
declarations are detected.
@@ -524,6 +554,8 @@ of ``-W(no-)*``.
:reverse: -Wno-noncanonical-monadfail-instances
:category:
+ :since: 8.0
+
This warning is deprecated. It no longer has any effect since GHC 8.8.
It was used during the transition period of the MonadFail proposal,
to detect when an instance of the ``Monad`` class was not defined
@@ -538,6 +570,8 @@ of ``-W(no-)*``.
:reverse: -Wno-noncanonical-monoid-instances
:category:
+ :since: 8.0
+
Warn if noncanonical ``Semigroup`` or ``Monoid`` instances
declarations are detected.
@@ -564,6 +598,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-monadfail-instances
:category:
+ :since: 8.0
+
This warning is deprecated. It no longer has any effect since GHC 8.8.
It was used during the transition period of the MonadFail proposal,
to warn when a failable pattern is used in a do-block that does not have
@@ -576,6 +612,8 @@ of ``-W(no-)*``.
:reverse: -Wno-semigroup
:category:
+ :since: 8.0
+
.. index::
single: semigroup; warning
@@ -595,6 +633,8 @@ of ``-W(no-)*``.
:reverse: -Wno-deprecated-flags
:category:
+ :since: 6.10
+
.. index::
single: deprecated flags
@@ -609,6 +649,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unsupported-calling-conventions
:category:
+ :since: 7.6
+
Causes a warning to be emitted for foreign declarations that use
unsupported calling conventions. In particular, if the ``stdcall``
calling convention is used on an architecture other than i386 then
@@ -620,6 +662,8 @@ of ``-W(no-)*``.
:reverse: -Wno-dodgy-foreign-imports
:category:
+ :since: 6.10
+
Causes a warning to be emitted for foreign imports of the following
form: ::
@@ -642,6 +686,8 @@ of ``-W(no-)*``.
:reverse: -Wno-dodgy-exports
:category:
+ :since: 6.12
+
Causes a warning to be emitted when a datatype ``T`` is exported
with all constructors, i.e. ``T(..)``, but is it just a type
synonym.
@@ -655,6 +701,8 @@ of ``-W(no-)*``.
:reverse: -Wno-dodgy-imports
:category:
+ :since: 6.8
+
Causes a warning to be emitted in the following cases:
- When a datatype ``T`` is imported with all constructors, i.e.
@@ -669,6 +717,8 @@ of ``-W(no-)*``.
:reverse: -Wno-overflowed-literals
:category:
+ :since: 7.8
+
Causes a warning to be emitted if a literal will overflow, e.g.
``300 :: Word8``.
@@ -678,6 +728,8 @@ of ``-W(no-)*``.
:reverse: -Wno-empty-enumerations
:category:
+ :since: 7.8
+
Causes a warning to be emitted if an enumeration is empty, e.g.
``[5 .. 3]``.
@@ -704,6 +756,8 @@ of ``-W(no-)*``.
:reverse: -Wno-duplicate-constraints
:category:
+ :since: 7.8
+
.. index::
single: duplicate constraints, warning
@@ -808,6 +862,8 @@ of ``-W(no-)*``.
:reverse: -Wno-identities
:category:
+ :since: 7.2
+
Causes the compiler to emit a warning when a Prelude numeric
conversion converts a type ``T`` to the same type ``T``; such calls are
probably no-ops and can be omitted. The functions checked for are:
@@ -820,6 +876,8 @@ of ``-W(no-)*``.
:reverse: -Wno-implicit-kind-vars
:category:
+ :since: 8.6
+
This warning is deprecated. It no longer has any effect since GHC 8.10.
It was used to detect if a kind variable is not explicitly quantified
over. For instance, the following would produce a warning: ::
@@ -857,6 +915,8 @@ of ``-W(no-)*``.
:reverse: -Wno-implicit-prelude
:category:
+ :since: 6.8
+
.. index::
single: implicit prelude, warning
@@ -881,6 +941,8 @@ of ``-W(no-)*``.
:reverse: -Wno-incomplete-patterns
:category:
+ :since: 5.04
+
.. index::
single: incomplete patterns, warning
single: patterns, incomplete
@@ -905,6 +967,8 @@ of ``-W(no-)*``.
:reverse: -Wno-incomplete-uni-patterns
:category:
+ :since: 7.2
+
The flag :ghc-flag:`-Wincomplete-uni-patterns` is similar to
:ghc-flag:`-Wincomplete-patterns`, except that it applies only to
lambda-expressions and pattern bindings, constructs that only allow a
@@ -946,6 +1010,8 @@ of ``-W(no-)*``.
:reverse: -Wno-incomplete-record-updates
:category:
+ :since: 6.4
+
.. index::
single: incomplete record updates, warning
single: record updates, incomplete
@@ -1032,6 +1098,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-import-lists
:category:
+ :since: 7.0
+
.. index::
single: missing import lists, warning
single: import lists, missing
@@ -1092,6 +1160,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-exported-sigs
:category:
+ :since: 7.10
+
.. index::
single: type signatures, missing
@@ -1105,6 +1175,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-exported-signatures
:category:
+ :since: 8.0
+
.. index::
single: type signatures, missing
@@ -1123,6 +1195,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-local-sigs
:category:
+ :since: 7.0
+
.. index::
single: type signatures, missing
@@ -1135,6 +1209,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-local-signatures
:category:
+ :since: 8.0
+
.. index::
single: type signatures, missing
@@ -1149,6 +1225,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missing-pattern-synonym-signatures
:category:
+ :since: 8.0
+
.. index::
single: type signatures, missing, pattern synonyms
@@ -1232,6 +1310,8 @@ of ``-W(no-)*``.
:reverse: -Wno-orphans
:category:
+ :since: 6.4
+
.. index::
single: orphan instances, warning
single: orphan rules, warning
@@ -1308,6 +1388,8 @@ of ``-W(no-)*``.
:reverse: -Wno-inaccessible-code
:category:
+ :since: 8.6
+
.. index::
single: inaccessible code, warning
single: inaccessible
@@ -1365,6 +1447,7 @@ of ``-W(no-)*``.
:extension:`StarIsType`
:type: dynamic
:reverse: -Wno-star-binder
+ :since: 8.6
Under :extension:`StarIsType`, a ``*`` in types is not an operator nor
even a name, it is special syntax that stands for ``Data.Kind.Type``. This
@@ -1424,6 +1507,8 @@ of ``-W(no-)*``.
:reverse: -Wno-tabs
:category:
+ :since: 6.8
+
.. index::
single: tabs, warning
@@ -1455,6 +1540,8 @@ of ``-W(no-)*``.
:reverse: -Wno-monomorphism-restriction
:category:
+ :since: 6.8
+
.. index::
single: monomorphism restriction, warning
@@ -1472,6 +1559,8 @@ of ``-W(no-)*``.
:reverse: -Wno-monomorphism-restriction
:category:
+ :since: 7.8
+
Warn when using :ghc-flag:`-fllvm` with an unsupported version of LLVM.
.. ghc-flag:: -Wmissed-extra-shared-lib
@@ -1480,6 +1569,8 @@ of ``-W(no-)*``.
:reverse: -Wno-missed-extra-shared-lib
:category:
+ :since: 8.8
+
Warn when GHCi can't load a shared lib it deduced it should load
when loading a package and analyzing the extra-libraries stanza
of the target package description.
@@ -1490,6 +1581,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unticked-promoted-constructors
:category:
+ :since: 7.10
+
.. index::
single: promoted constructor, warning
@@ -1534,6 +1627,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-top-binds
:category:
+ :since: 8.0
+
.. index::
single: unused binds, warning
single: binds, unused
@@ -1568,6 +1663,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-local-binds
:category:
+ :since: 8.0
+
.. index::
single: unused binds, warning
single: binds, unused
@@ -1584,6 +1681,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-pattern-binds
:category:
+ :since: 8.0
+
.. index::
single: unused binds, warning
single: binds, unused
@@ -1648,6 +1747,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-do-bind
:category:
+ :since: 6.12
+
.. index::
single: unused do binding, warning
single: do binding, unused
@@ -1674,6 +1775,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-type-patterns
:category:
+ :since: 8.0
+
.. index::
single: unused type patterns, warning
single: type patterns, unused
@@ -1709,6 +1812,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unused-foralls
:category:
+ :since: 8.0
+
.. index::
single: unused foralls, warning
single: foralls, unused
@@ -1814,6 +1919,8 @@ of ``-W(no-)*``.
:reverse: -Wno-wrong-do-bind
:category:
+ :since: 6.12
+
.. index::
single: apparently erroneous do binding, warning
single: do binding, apparently erroneous
@@ -1843,6 +1950,8 @@ of ``-W(no-)*``.
:reverse: -Wno-inline-rule-shadowing
:category:
+ :since: 7.8
+
Warn if a rewrite RULE might fail to fire because the function might
be inlined before the rule has a chance to fire. See
:ref:`rules-inline`.
@@ -1865,6 +1974,8 @@ of ``-W(no-)*``.
:reverse: -Wno-unbanged-strict-patterns
:category:
+ :since: 8.2
+
This flag warns whenever you write a pattern that binds a variable whose
type is unlifted, and yet the pattern is not a bang pattern nor a bare variable.
See :ref:`glasgow-unboxed` for information about unlifted types.
@@ -1992,12 +2103,14 @@ of ``-W(no-)*``.
.. ghc-flag:: -Wauto-orphans
:shortdesc: *(deprecated)* Does nothing
:type: dynamic
+ :since: 7.4
Does nothing.
.. ghc-flag:: -Wmissing-space-after-bang
:shortdesc: *(deprecated)* Does nothing
:type: dynamic
+ :since: 8.8
Does nothing.