From fec7510f3acc392db938a79760d431ea07822395 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 14 Nov 2008 19:30:11 +0000 Subject: [PATCH] Stopped warning about the _sizes variables being unused (but do remove them) --- checks/Check.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/Check.hs b/checks/Check.hs index 9d588f4..d8c6b78 100644 --- a/checks/Check.hs +++ b/checks/Check.hs @@ -287,7 +287,9 @@ checkUnusedVar = forAnyASTStruct doSpec doMaybe $ flip fmap mvars $ \vars -> do liftIO $ putStrLn $ "Analysing: " ++ show mspec when (not $ (Var $ A.Variable emptyMeta name) `Set.member` vars) $ - do warnPC mspec WarnUnusedVariable $ formatCode "Unused variable: %" name + do -- TODO have a more general way of not warning about compiler-generated names: + when (not $ "_sizes" `isSuffixOf` A.nameName name) $ + warnPC mspec WarnUnusedVariable $ formatCode "Unused variable: %" name substitute scope doSpec _ = return ()