summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-03-26 19:58:13 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-06 13:03:16 -0400
commitc41c478eb9003eaa9fc8081a0039652448124f5d (patch)
tree82a962e73d37b5c3d9b705ad211aeb69cfd2c265 /utils
parent018453751b10cf26506d5076f08fc3a537973d9e (diff)
downloadhaskell-c41c478eb9003eaa9fc8081a0039652448124f5d.tar.gz
Fix a few new warnings when booting with GHC 9.2.2
-Wuni-incomplete-patterns and apparent improvements in the pattern match checker surfaced these.
Diffstat (limited to 'utils')
-rw-r--r--utils/deriveConstants/Main.hs2
-rw-r--r--utils/genprimopcode/Main.hs6
2 files changed, 6 insertions, 2 deletions
diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs
index 4832ccfc89..9a57ecf682 100644
--- a/utils/deriveConstants/Main.hs
+++ b/utils/deriveConstants/Main.hs
@@ -814,7 +814,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram
, Just sym <- stripPrefix prefix sym0 = Just (sym, read n)
| otherwise = Nothing
where
- [sym0, _] = take 2 (reverse $ words l1)
+ sym0 = head $ reverse $ words l1
-- If an Int value is larger than 2^28 or smaller
-- than -2^28, then fail.
diff --git a/utils/genprimopcode/Main.hs b/utils/genprimopcode/Main.hs
index c4261e1e00..2bd12e117b 100644
--- a/utils/genprimopcode/Main.hs
+++ b/utils/genprimopcode/Main.hs
@@ -673,7 +673,11 @@ gen_primop_list (Info _ entries)
map (\p -> " , " ++ cons p) rest
++
[ " ]" ]
- ) where (first:rest) = concatMap desugarVectorSpec (filter is_primop entries)
+ ) where
+ (first,rest) =
+ case concatMap desugarVectorSpec (filter is_primop entries) of
+ x:xs -> (x,xs)
+ [] -> error "gen_primop_list: no primops"
mIN_VECTOR_UNIQUE :: Int
mIN_VECTOR_UNIQUE = 300