From a896a1012dcceba38d7344e03bd784b17243fad7 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 7 Jul 2016 12:31:54 -0400 Subject: [PATCH] Enable/fix more warnings for GHC 8+. --- haeredes.cabal | 30 ++++++++++-------------------- src/CommandLine.hs | 2 +- src/Main.hs | 9 +++++---- src/Timeout.hs | 2 +- test/Doctests.hs | 2 +- 5 files changed, 18 insertions(+), 27 deletions(-) diff --git a/haeredes.cabal b/haeredes.cabal index c136299..4ce5f67 100644 --- a/haeredes.cabal +++ b/haeredes.cabal @@ -101,16 +101,11 @@ executable haeredes Timeout ghc-options: - -Wall - -fwarn-hi-shadowing - -fwarn-missing-signatures - -fwarn-name-shadowing - -fwarn-orphans - -fwarn-type-defaults - -fwarn-tabs - -fwarn-incomplete-record-updates - -fwarn-monomorphism-restriction - -fwarn-unused-do-bind + -Weverything + -Wno-implicit-prelude + -Wno-safe + -Wno-unsafe + -Wno-all-missed-specialisations -rtsopts -threaded -optc-O3 @@ -129,16 +124,11 @@ test-suite doctests -- It's not entirely clear to me why I have to reproduce all of this. ghc-options: - -Wall - -fwarn-hi-shadowing - -fwarn-missing-signatures - -fwarn-name-shadowing - -fwarn-orphans - -fwarn-type-defaults - -fwarn-tabs - -fwarn-incomplete-record-updates - -fwarn-monomorphism-restriction - -fwarn-unused-do-bind + -Weverything + -Wno-implicit-prelude + -Wno-safe + -Wno-unsafe + -Wno-all-missed-specialisations -rtsopts -threaded -optc-O3 diff --git a/src/CommandLine.hs b/src/CommandLine.hs index bd8b2f9..5539605 100644 --- a/src/CommandLine.hs +++ b/src/CommandLine.hs @@ -31,7 +31,7 @@ import System.Console.CmdArgs ( import Paths_haeredes (version) import Data.Version (showVersion) -import Timeout (Timeout(..)) +import Timeout (Timeout(seconds)) -- | Description of the 'NS' mode. diff --git a/src/Main.hs b/src/Main.hs index f513ec6..f7a56ea 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -20,18 +20,19 @@ import Network.DNS ( normalize, normalizeCase, withResolver ) -import System.Exit (ExitCode(..), exitWith) +import System.Exit (ExitCode(ExitFailure), exitWith) import System.IO (hPutStrLn, stderr) - -import CommandLine (Args(..), get_args) +import CommandLine ( + Args(NS,MX,delegates,no_append_root,server,timeout), + get_args) import DNS ( LookupResult, lookupMX', lookupNS', resolve_address ) import ExitCodes (exit_bad_server) -import Timeout (Timeout(..)) +import Timeout (Timeout(seconds)) -- | Given a list of delegates, report results for this diff --git a/src/Timeout.hs b/src/Timeout.hs index 0b0f2e1..70cadf9 100644 --- a/src/Timeout.hs +++ b/src/Timeout.hs @@ -7,7 +7,7 @@ module Timeout where import Data.Data (Data) -import System.Console.CmdArgs.Default (Default(..)) +import System.Console.CmdArgs.Default (Default(def)) newtype Timeout = Timeout { seconds :: Int } diff --git a/test/Doctests.hs b/test/Doctests.hs index d183b4b..0c9ec0a 100644 --- a/test/Doctests.hs +++ b/test/Doctests.hs @@ -1,7 +1,7 @@ module Main where -import Test.DocTest +import Test.DocTest (doctest) import System.FilePath.Find ((==?), always, extension, find) find_sources :: IO [FilePath] -- 2.43.2