From c3353d602590407951f2cdb4f3c01108d10bf389 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 11 Feb 2008 00:56:10 +0000 Subject: [PATCH] Changed the uninitialised-variables notification from a fatal error down to a warning --- checks/Check.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checks/Check.hs b/checks/Check.hs index d0c18db..e2792a6 100644 --- a/checks/Check.hs +++ b/checks/Check.hs @@ -143,7 +143,7 @@ showCodeExSet (NormalSet s) return $ "{" ++ concat (intersperse ", " ss) ++ "}" -- | Checks that no variable is used uninitialised. That is, it checks that every variable is written to before it is read. -checkInitVar :: forall m. (Monad m, Die m, CSMR m) => Meta -> FlowGraph m UsageLabel -> Node -> m () +checkInitVar :: forall m. (Monad m, Die m, Warn m, CSMR m) => Meta -> FlowGraph m UsageLabel -> Node -> m () checkInitVar m graph startNode = do startLabel <- checkJust (Just m, "Could not find starting node in the control-flow graph") (lab graph startNode) >>* writeNode @@ -194,7 +194,7 @@ checkInitVar m graph startNode -- The read-from set should be a subset of the written-to set: if filterPlain' v `isSubsetOf` filterPlain' vs then return () else do vars <- showCodeExSet $ filterPlain' v `difference` filterPlain' vs - dieP (getMeta n) $ "Variable(s) read from are not written to before-hand: " ++ vars + addWarning (getMeta n) $ "Variable(s) read from are not written to before-hand: " ++ vars checkParAssignUsage :: forall m t. (CSMR m, Die m, MonadIO m, Data t) => t -> m () checkParAssignUsage = mapM_ checkParAssign . listify isParAssign