diff options
-rw-r--r-- | aclocal.m4 | 11 | ||||
-rw-r--r-- | compiler/cmm/CmmLex.x | 11 | ||||
-rw-r--r-- | compiler/cmm/CmmParse.y | 8 | ||||
-rw-r--r-- | compiler/parser/Lexer.x | 23 | ||||
-rw-r--r-- | compiler/parser/Parser.y | 8 | ||||
-rw-r--r-- | utils/genapply/GenApply.hs | 11 | ||||
-rw-r--r-- | utils/genprimopcode/Lexer.x | 18 | ||||
-rw-r--r-- | utils/genprimopcode/Parser.y | 8 | ||||
-rw-r--r-- | utils/hpc/HpcParser.y | 16 |
9 files changed, 44 insertions, 70 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 22e6d1fa83..97731685a9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -872,9 +872,11 @@ AS_IF([test "$fp_num1" $2 "$fp_num2"], [$4], [$5])[]dnl dnl -dnl Check for Happy and version. If we're building GHC, then we need -dnl at least Happy version 1.19. If there's no installed Happy, we look +dnl Check for Happy and version. +dnl If there's no installed Happy, we look dnl for a happy source tree and point the build system at that instead. +dnl If you increase the minimum version requirement, please also update: +dnl https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools dnl AC_DEFUN([FPTOOLS_HAPPY], [FP_PATH_PROG(HappyCmd,happy,) @@ -899,8 +901,9 @@ AC_SUBST(HappyVersion) ]) dnl -dnl Check for Alex and version. If we're building GHC, then we need -dnl at least Alex version 2.1.1. +dnl Check for Alex and version. +dnl If you increase the minimum version requirement, please also update: +dnl https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Tools dnl AC_DEFUN([FPTOOLS_ALEX], [ diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index 65c85f1ac4..820899b8d4 100644 --- a/compiler/cmm/CmmLex.x +++ b/compiler/cmm/CmmLex.x @@ -11,9 +11,12 @@ ----------------------------------------------------------------------------- { -{-# LANGUAGE BangPatterns #-} -{-# OPTIONS -Wwarn -w #-} --- The above -Wwarn suppression flag is a temporary kludge. +{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-} +-- The above warning suppression flags are a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See -- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings @@ -35,7 +38,7 @@ import Util --import TRACE import Data.Word -import Data.Char +import Data.Char hiding (ord) } $whitechar = [\ \t\n\r\f\v\xa0] -- \xa0 is Unicode no-break space diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 694d79ead9..9638c142d0 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -195,14 +195,6 @@ convention. ----------------------------------------------------------------------------- -} { -{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 -{-# OPTIONS -Wwarn -w #-} --- The above warning suppression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - module CmmParse ( parseCmmFile ) where import StgCmmExtCode diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 2e883fd102..1ee5c0315f 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -43,15 +43,17 @@ { -- XXX The above flags turn off warnings in the generated code: {-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} -{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} --- But alex still generates some code that causes the "lazy unlifted bindings" --- warning, and old compilers don't know about it so we can't easily turn --- it off, so for now we use the sledge hammer: -{-# OPTIONS_GHC -w #-} +{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} +{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} +-- The above warning suppression flags are a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details {-# OPTIONS_GHC -funbox-strict-fields #-} @@ -77,13 +79,14 @@ module Lexer ( ) where -- base +#if __GLASGOW_HASKELL__ < 709 import Control.Applicative +#endif import Control.Monad import Data.Bits -import Data.Char +import Data.Char hiding (ord) import Data.List import Data.Maybe -import Data.Ratio import Data.Word -- bytestring @@ -93,10 +96,6 @@ import Data.ByteString (ByteString) import Data.Map (Map) import qualified Data.Map as Map --- data/typeable -import Data.Data -import Data.Typeable - -- compiler/utils import Bag import Outputable diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index b20b50c91b..a2d89b2498 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -8,14 +8,6 @@ -- --------------------------------------------------------------------------- { -{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 -{-# OPTIONS -Wwarn -w #-} --- The above warning suppression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - -- | This module provides the generated Happy parser for Haskell. It exports -- a number of parsers which may be used in any library that uses the GHC API. -- A common usage pattern is to initialize the parser state with a given string diff --git a/utils/genapply/GenApply.hs b/utils/genapply/GenApply.hs index 7ff1b877a0..26b5154395 100644 --- a/utils/genapply/GenApply.hs +++ b/utils/genapply/GenApply.hs @@ -1,6 +1,11 @@ -{-# OPTIONS -cpp -fglasgow-exts #-} -{-# OPTIONS -w #-} --- The above warning suppression flag is a temporary kludge. +{-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -fno-warn-unused-matches #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-} +{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} +{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} +{-# OPTIONS_GHC -fno-warn-name-shadowing #-} +-- The above warning suppression flags are a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See -- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings diff --git a/utils/genprimopcode/Lexer.x b/utils/genprimopcode/Lexer.x index 4887f46cca..3ec6c2ef6e 100644 --- a/utils/genprimopcode/Lexer.x +++ b/utils/genprimopcode/Lexer.x @@ -1,8 +1,11 @@ { -{-# LANGUAGE BangPatterns #-} -- required for versions of Alex before 2.3.4 -{-# OPTIONS -w -Wwarn #-} --- The above warning suppression flag is a temporary kludge. +{-# OPTIONS_GHC -fno-warn-unused-matches #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +-- The above warning suppression flags are a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See -- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings @@ -10,11 +13,12 @@ module Lexer (lex_tok) where -import ParserM (ParserM (..), mkT, mkTv, Token(..), St, start_code, +import ParserM (ParserM (..), mkT, mkTv, Token(..), start_code, set_start_code, inc_brace_depth, dec_brace_depth, - show_pos, position, input, - AlexInput, alexGetChar, alexGetByte, alexInputPrevChar) + show_pos, position, + AlexInput, alexGetByte) +import qualified ParserM as ParserM (input) } words :- @@ -81,7 +85,7 @@ get_tok = ParserM $ \i st -> AlexError _ -> Left ("Lexical error at " ++ show_pos (position i)) AlexSkip i' _ -> case get_tok of ParserM f -> f i' st - AlexToken i' l a -> case a $ take l $ input i of + AlexToken i' l a -> case a $ take l $ ParserM.input i of ParserM f -> f i' st lex_tok :: (Token -> ParserM a) -> ParserM a diff --git a/utils/genprimopcode/Parser.y b/utils/genprimopcode/Parser.y index c70ff1ae89..6a3c0d0043 100644 --- a/utils/genprimopcode/Parser.y +++ b/utils/genprimopcode/Parser.y @@ -1,12 +1,4 @@ { -{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 -{-# OPTIONS -w -Wwarn #-} --- The above warning suppression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - module Parser (parse) where import Lexer (lex_tok) diff --git a/utils/hpc/HpcParser.y b/utils/hpc/HpcParser.y index 5f8bf903bb..bff9530384 100644 --- a/utils/hpc/HpcParser.y +++ b/utils/hpc/HpcParser.y @@ -1,20 +1,4 @@ { -{-# LANGUAGE BangPatterns #-} -- required for versions of Happy before 1.18.6 -{-# OPTIONS -Wwarn -XNoMonomorphismRestriction #-} --- The NoMonomorphismRestriction deals with a Happy infelicity --- With OutsideIn's more conservativ monomorphism restriction --- we aren't generalising --- notHappyAtAll = error "urk" --- which is terrible. Switching off the restriction allows --- the generalisation. Better would be to make Happy generate --- an appropriate signature. --- --- The above warning suppression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - module HpcParser where import HpcLexer |