RE: [commit: ghc] master: Use -fno-warn-unused-imports instead of hiding `ord` (c875b08)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: [commit: ghc] master: Use -fno-warn-unused-imports instead of hiding `ord` (c875b08)

Simon Peyton Jones
Add a comment, please, I beg you!  In five years time no one will have a clue why that `-fno-warn-unused-imports` flag is there.

It's a small thing I know, but the principle is: whenever adding a line of code whose purpose is not locally obvious, explain by adding a comment, or Note, or Trac reference, or all three.

Simon

|  -----Original Message-----
|  From: ghc-commits [mailto:[hidden email]] On Behalf
|  Of [hidden email]
|  Sent: 04 July 2015 23:44
|  To: [hidden email]
|  Subject: [commit: ghc] master: Use -fno-warn-unused-imports instead of
|  hiding `ord` (c875b08)
|  
|  Repository : ssh://[hidden email]/ghc
|  
|  On branch  : master
|  Link       :
|  http://ghc.haskell.org/trac/ghc/changeset/c875b085d95377771a5b3cf0f44b
|  b2910dbfe966/ghc
|  
|  >---------------------------------------------------------------
|  
|  commit c875b085d95377771a5b3cf0f44bb2910dbfe966
|  Author: Thomas Miedema <[hidden email]>
|  Date:   Sat Jul 4 18:20:06 2015 +0200
|  
|      Use -fno-warn-unused-imports instead of hiding `ord`
|  
|      This is more future proof. Maybe later versions of Alex won't
|  `import
|      Data.Char (ord)` anymore.
|  
|  
|  >---------------------------------------------------------------
|  
|  c875b085d95377771a5b3cf0f44bb2910dbfe966
|   compiler/cmm/CmmLex.x   | 3 ++-
|   compiler/parser/Lexer.x | 3 ++-
|   2 files changed, 4 insertions(+), 2 deletions(-)
|  
|  diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index
|  cb71c7d..fca5a1e 100644
|  --- a/compiler/cmm/CmmLex.x
|  +++ b/compiler/cmm/CmmLex.x
|  @@ -13,6 +13,7 @@
|   {
|   {-# 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 #-}
|   -- The above warning suppression flags are a temporary kludge.
|  @@ -37,7 +38,7 @@ import Util
|   --import TRACE
|  
|   import Data.Word
|  -import Data.Char hiding (ord)
|  +import Data.Char
|   }
|  
|   $whitechar   = [\ \t\n\r\f\v\xa0] -- \xa0 is Unicode no-break space
|  diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index
|  8e6e67d..df7347e 100644
|  --- a/compiler/parser/Lexer.x
|  +++ b/compiler/parser/Lexer.x
|  @@ -45,6 +45,7 @@
|   {-# LANGUAGE BangPatterns #-}
|   {-# 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 #-}  {-# OPTIONS_GHC -
|  fno-warn-overlapping-patterns #-} @@ -84,7 +85,7 @@ import
|  Control.Applicative  #endif  import Control.Monad  import Data.Bits -
|  import Data.Char hiding (ord)
|  +import Data.Char
|   import Data.List
|   import Data.Maybe
|   import Data.Word
|  
|  _______________________________________________
|  ghc-commits mailing list
|  [hidden email]
|  http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-commits
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs