Skip to content

Fix warnings in genapply

Sylvain Henry requested to merge hsyl20/ghc:hsyl20/genapply into master

Fix the following warnings:

utils/genapply/Main.hs:18:1: warning: [-Wunused-imports]
    The import of ‘System.Exit’ is redundant
      except perhaps to import instances from ‘System.Exit’
    To import instances alone, use: import System.Exit()
   |
18 | import System.Exit
   | ^^^^^^^^^^^^^^^^^^

utils/genapply/Main.hs:20:1: warning: [-Wunused-imports]
    The import of ‘System.IO’ is redundant
      except perhaps to import instances from ‘System.IO’
    To import instances alone, use: import System.IO()
   |
20 | import System.IO
   | ^^^^^^^^^^^^^^^^

utils/genapply/Main.hs:81:65: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘[String]’ not matched:
            []
            [_]
            (_:_:_:_)
   |
81 |   let tups = [ (k, read v) | '/':'/':' ':l <- lines header, let [k, v] = words l ]
   |                                                                 ^^^^^^^^^^^^^^^^

utils/genapply/Main.hs:82:28: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘Maybe Int’ not matched: Nothing
   |
82 |       tups_get k = v where Just v = lookup k tups
   |                            ^^^^^^^^^^^^^^^^^^^^^^

utils/genapply/Main.hs:445:24: warning: [-Wunused-matches]
    Defined but not used: ‘reg’
    |
445 |                       (reg, fst_off):_ -> fst_off
    |   

Merge request reports