[MLton-commit] r7535

Matthew Fluet fluet at mlton.org
Fri May 27 08:00:31 PDT 2011


Unused but set variables detected by gcc 4.6.

In gcc 4.6, -Wall implies -Wunused and -Wunused implies
-Wunused-but-set-variable.  Eliminate this unused variable warning by
restoring the invariant check that uses the variable.
----------------------------------------------------------------------

U   mlton/trunk/runtime/gc/invariant.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/gc/invariant.c
===================================================================
--- mlton/trunk/runtime/gc/invariant.c	2011-05-27 15:00:11 UTC (rev 7534)
+++ mlton/trunk/runtime/gc/invariant.c	2011-05-27 15:00:21 UTC (rev 7535)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
+/* Copyright (C) 2011 Matthew Fluet.
+ * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
  *    Jagannathan, and Stephen Weeks.
  * Copyright (C) 1997-2000 NEC Research Institute.
  *
@@ -42,6 +43,8 @@
 
       assert (layout->size <= s->maxFrameSize);
       offsets = layout->offsets;
+      for (unsigned int j = 0; j < offsets[0]; ++j)
+        assert (offsets[j + 1] < layout->size);
     }
   }
   /* Generational */




More information about the MLton-commit mailing list