[m-rev.] diff: avoid gcc warnings in .agc grades
Julien Fischer
juliensf at cs.mu.OZ.AU
Thu Mar 16 17:19:35 AEDT 2006
Estimated hours taken: 0.2
Branches: main
Avoid some warnings from gcc in the .agc grades.
compiler/mercury_regs.h:
Define a new macro MR_virtual_hp_word so that we can assign to
MR_virtual_hp without warnings from gcc about casts in lvalues being
deprecated.
compiler/mercury_accurate_gc.c:
Use the new macro to avoid some warnings.
Julien.
Index: mercury_accurate_gc.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_accurate_gc.c,v
retrieving revision 1.40
diff -u -r1.40 mercury_accurate_gc.c
--- mercury_accurate_gc.c 16 Sep 2005 16:43:54 -0000 1.40
+++ mercury_accurate_gc.c 16 Mar 2006 05:44:25 -0000
@@ -161,7 +161,7 @@
** The new heap pointer starts at the bottom of the new heap.
*/
swap_heaps();
- MR_virtual_hp = new_heap->MR_zone_min;
+ MR_virtual_hp_word = (MR_Word) new_heap->MR_zone_min;
/*
** Copy any roots on the stack
@@ -950,7 +950,7 @@
/* XXX restore this, it appears to get clobbered */
fprintf(stderr, "MR_virtual_hp: %lx\n", (long) MR_virtual_hp);
- MR_virtual_hp = new_hp;
+ MR_virtual_hp_word = (MR_Word) new_hp;
fprintf(stderr, "MR_virtual_hp: %lx\n", (long) MR_virtual_hp);
fprintf(stderr, "old heap: %ld bytes, new heap: %ld bytes\n",
Index: mercury_regs.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_regs.h,v
retrieving revision 1.26
diff -u -r1.26 mercury_regs.h
--- mercury_regs.h 2 Dec 2005 06:53:18 -0000 1.26
+++ mercury_regs.h 16 Mar 2006 05:42:17 -0000
@@ -645,6 +645,7 @@
#define MR_virtual_succip MR_saved_succip(MR_fake_reg)
#define MR_virtual_hp MR_saved_hp(MR_fake_reg)
+#define MR_virtual_hp_word MR_saved_hp_word(MR_fake_reg)
#define MR_virtual_sp MR_saved_sp(MR_fake_reg)
#define MR_virtual_curfr MR_saved_curfr(MR_fake_reg)
#define MR_virtual_maxfr MR_saved_maxfr(MR_fake_reg)
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list