diff: runtime/memory.c bug fix

Fergus Henderson fjh at cs.mu.oz.au
Thu Jul 17 06:23:30 AEST 1997


runtime/memory.c:
	Fix a bug in the printfs() in debug_memory().  It was trying to
	print out `size_t' values using "%d", which is non-portable.

Index: memory.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/memory.c,v
retrieving revision 1.71
diff -u -r1.71 memory.c
--- memory.c	1997/06/11 07:02:59	1.71
+++ memory.c	1997/07/16 20:21:01
@@ -277,12 +277,12 @@
 	MemoryZone	*zone;
 
 	fprintf(stderr, "\n");
-	fprintf(stderr, "pcache_size  = %d (0x%x)\n",
-		pcache_size, pcache_size);
-	fprintf(stderr, "page_size    = %d (0x%x)\n",
-		page_size, page_size);
-	fprintf(stderr, "unit         = %d (0x%x)\n",
-		unit, unit);
+	fprintf(stderr, "pcache_size  = %lu (0x%lx)\n",
+		(unsigned long) pcache_size, (unsigned long) pcache_size);
+	fprintf(stderr, "page_size    = %lu (0x%lx)\n",
+		(unsigned long) page_size, (unsigned long) page_size);
+	fprintf(stderr, "unit         = %lu (0x%lx)\n",
+		(unsigned long) unit, (unsigned long) unit);
 
 	fprintf(stderr, "\n");
 	fprintf(stderr, "fake_reg       = %p (offset %ld)\n",

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list