[remove some warningns in generate, sort local variable declarations, add more warnings checks on generated c code, don't assign to unused vars bound in case statements
John Meacham <john@repetae.net>**20080312131000] hunk ./C/FromGrin2.hs 214
-convertType (TyPrim opty) = return (opTyToC opty)
+convertType ~(TyPrim opty) = return (opTyToC opty)
hunk ./C/FromGrin2.hs 273
-        da (NodeC t as) e = do
+        da ~(NodeC t as) e = do
hunk ./C/FromGrin2.hs 284
-        am (NodeC t2 _) e = annotate (show p2) (f_assert ((constant $ enum (nodeTagName t2)) `eq` tag) & e)
+        am ~(NodeC t2 _) e = annotate (show p2) (f_assert ((constant $ enum (nodeTagName t2)) `eq` tag) & e)
hunk ./C/FromGrin2.hs 305
+        da ([(Var v _)] :-> e) | v == v0 = do
+            e' <- convertBody e
+            return $ (Nothing,e')
hunk ./C/FromGrin2.hs 316
-        da ([(NodeC t as)] :-> e) = do
+        da (~[(NodeC t as)] :-> e) = do
hunk ./C/FromGrin2.hs 324
-                needed (Var v _) = v `Set.member` fve
+                needed ~(Var v _) = v `Set.member` fve
hunk ./C/FromGrin2.hs 330
-    let da ([v@(Var {})] :-> e) = do
+    let da ([(Var vv _)] :-> e) | vv == v0 = do
+            e' <- convertBody e
+            return (Nothing,e')
+        da ([v@(Var {})] :-> e) = do
hunk ./C/FromGrin2.hs 337
-        da ([(Lit i _)] :-> e) = do
+        da (~[(Lit i _)] :-> e) = do
hunk ./C/FromGrin2.hs 440
+        _ -> error "simpleRet: odd rTodo"
hunk ./C/FromGrin2.hs 520
-        cd = text "const static struct " <> tshow (nodeStructName a) <+> text "_c" <> tshow i <+> text "= {" <> hsep (punctuate P.comma (ntag ++ rs)) <> text "};"
+        cd = text "static const  struct " <> tshow (nodeStructName a) <+> text "_c" <> tshow i <+> text "= {" <> hsep (punctuate P.comma (ntag ++ rs)) <> text "};"
hunk ./C/Generate.hs 136
--- The Bool in TB and TPtr are whether the GC needs to consider the types to
+-- The Bool in TB and is whether the GC needs to consider the types to
hunk ./C/Generate.hs 180
+subBlockBody s = do
+    let vcmp (n,t@(TB _ b)) = (not b,n)
+        vcmp (n,t) = (True,n)
+    is <- asks envInScope
+    (body,uv) <- censor (const []) $ listen (draw s)
+    uv' <- forM [ (x,t) | (x,t) <- snubUnder vcmp uv, (x /= toName "v0") && (x `Set.notMember` is)] $ \ (n,t) -> do
+        t <- draw t
+        return $ t <+> tshow n <> semi
+    return $ vcat uv' $$ body
hunk ./C/Generate.hs 451
-    let env = cenv { envUsedLabels = ul } where
+    let env = cenv { envUsedLabels = ul, envInScope = Set.fromList $ fsts (functionArgs f) } where
hunk ./C/Generate.hs 456
+        vcmp (n,t@(TB _ b)) = (not b,n)
+        vcmp (n,t) = (True,n)
hunk ./C/Generate.hs 459
-    uv' <- forM [ (x,t) | (x,t) <- snubUnder fst uv, x `notElem` fsts (functionArgs f)] $ \ (n,t) -> do
+    uv' <- forM [ (x,t) | (x,t) <- snubUnder vcmp uv, x `notElem` fsts (functionArgs f)] $ \ (n,t) -> do
hunk ./Main.hs 774
-        comm = shellQuote $ [optCC options, "-std=gnu99", "-D_GNU_SOURCE", "-falign-functions=4", "-ffast-math", "-Wall", "-o", fn, cf ] ++ (map ("-l" ++) rls) ++ debug ++ optCCargs options  ++ boehmOpts ++ profileOpts
+        comm = shellQuote $ [optCC options, "-std=gnu99", "-D_GNU_SOURCE", "-falign-functions=4", "-ffast-math", "-Wshadow", "-Wextra", "-Wall", "-Wno-unused-parameter", "-o", fn, cf ] ++ (map ("-l" ++) rls) ++ debug ++ optCCargs options  ++ boehmOpts ++ profileOpts