Automatically enable version-dependent GHC flags
authorIustin Pop <iustin@google.com>
Tue, 13 Nov 2012 10:46:04 +0000 (11:46 +0100)
committerIustin Pop <iustin@google.com>
Tue, 13 Nov 2012 13:42:34 +0000 (14:42 +0100)
commit39f0eea533056c8a26da089a774a27b13097e489
tree48356d2aeb908e4c08f1bb67bead3b3631233b8c
parent43b3b5c1fc184224fffc34f124f190794d8599ea
Automatically enable version-dependent GHC flags

Some GHC flags are very useful, but only appear in more recent GHC
versions. To support the use of such flags while still supporting
older compilers, let's add conditional checks and enabling based on
the results.

Currently only `-fwarn-incomplete-uni-patterns` is enabled, which
detects refutable patterns in lambda expressions and pattern bindings
(e.g. "let (Just x) = y"); such constructs are bad as they can lead to
runtime exceptions.

Additionally, fix an existing such bad construct in a test case; we
workaround it by using error, since that should never fail.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Makefile.am
configure.ac
htest/Test/Ganeti/HTools/Cluster.hs