Commit 69beef56 authored by thomie's avatar thomie

Replace usages of `-w` by `-fno-warn`s

And remove unused imports and language pragmas.

I checked that the minimum Happy and Alex version requirements, as
listed in aclocal.m4, don't have to change. Before building ghc, I ran:
  - cabal install happy==1.19.4 --with-ghc=ghc-7.8.4
  - cabal install alex==3.1.0 --with-ghc=ghc-7.6.3

Differential Revision: https://phabricator.haskell.org/D1032
parent 889c81c6
......@@ -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],
[
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
{-# 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
......
{
{-# 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
......
{
{-# 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)
......
{
{-# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment