diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-10-22 19:01:49 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-10-22 20:18:13 +1100 |
commit | 767ee632167271475eb40b1c8bc53ac54c7031e4 (patch) | |
tree | 8c7bf06e8cdef8799d3d96d0d5fa56897d3f4334 /docs/users_guide/using-warnings.rst | |
parent | f41a8a369796985a75dd618b969292e1e7033112 (diff) | |
download | haskell-wip/erikd/cpp-undef.tar.gz |
Add -Wcpp-undef warning flagwip/erikd/cpp-undef
Summary:
When enabled, this new warning flag passes `-Wundef` to the C
pre-processor which causes the pre-processor to warn on uses of
the `#if` directive on undefined identifiers.
It is not currently enabled in any of the standard warning groups.
Test Plan:
Add a test to this commit and make sure the test passes
on all major platforms.
Reviewers: bgamari, hvr, austin, Phyx, carter
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2626
GHC Trac Issues: #12752
Diffstat (limited to 'docs/users_guide/using-warnings.rst')
-rw-r--r-- | docs/users_guide/using-warnings.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index c07058a4ef..c9216b9307 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -1007,6 +1007,12 @@ of ``-W(no-)*``. be inlined before the rule has a chance to fire. See :ref:`rules-inline`. +.. ghc-flag:: -Wcpp-undef + + This flag passes ``-Wundef`` to the C pre-processor (if its being used) + which causes the pre-processor to warn on uses of the `#if` directive on + undefined identifiers. + If you're feeling really paranoid, the :ghc-flag:`-dcore-lint` option is a good choice. It turns on heavyweight intra-pass sanity-checking within GHC. (It checks GHC's sanity, not yours.) |