Fix #15656 by extending -Wall with appropriate flags
Needs ReviewPublic

Authored by ckoparkar on Dec 5 2018, 10:36 AM.

Details

Summary

We extend -Wall with incomplete-uni-patterns and
incomplete-record-updates as per GHC proposal Trac #12[1].

However, doing so gives rise to warnings due to code that is considered
unsafe per these two flags. For now, we just suppress these warnings
to make the build less noisy. The proper solution would be to refine
things so that these warnings go away. This idea is tracked by Trac Trac #16041.

[1] https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0012-Wall-uni-patterns.rst

Test Plan

make test TEST=T15656

ckoparkar created this revision.Dec 5 2018, 10:36 AM

I looked at the stage1 and stage2 build logs, and GHC itself didn't generate any new warnings. I'll try to fix any warnings that other libraries in haskell/ might generate.

( Running make clean && make on GHC HEAD now).

ckoparkar planned changes to this revision.Dec 5 2018, 11:14 AM

Sorry, I was wrong. GHC does generate warnings because of this.

ckoparkar updated this revision to Diff 19119.Dec 12 2018, 9:44 AM

Supress warnings.

ckoparkar edited the summary of this revision. (Show Details)Dec 12 2018, 9:45 AM
ckoparkar edited reviewers, added: RolandSenn; removed: hvr, simonmar, jrtc27.

Note that the build won't be totally warning free just yet because this patch doesn't suppress these warnings for the libraries.

(I'm submitting pull requests on GitHub, and we can bump the appropriate submodules when they're merged)

Note that the build won't be totally warning free just yet because this patch doesn't suppress these warnings for the libraries.

(I'm submitting pull requests on GitHub, and we can bump the appropriate submodules when they're merged)

Thanks for doing this! Let us know when the changes have all made it upstream.

compiler/typecheck/TcRnDriver.hs
21

Duplicate pragma.

ckoparkar updated this revision to Diff 19125.Dec 12 2018, 2:43 PM

Remove duplicate pragma.

ckoparkar marked an inline comment as done.Dec 12 2018, 2:44 PM
ckoparkar added inline comments.
compiler/typecheck/TcRnDriver.hs
21

Good catch!