From 6ac5dcb1f427bbb99ef1530af0bb122bb302a773 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Wed, 8 Mar 2023 11:03:27 +0000 Subject: [PATCH] Declaring variable as static volatile to ensure clean communication with debugger and suppress warnings. this is a better expression of intention. --- mps/code/amcss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mps/code/amcss.c b/mps/code/amcss.c index 5f7ed999013..2923d6654da 100644 --- a/mps/code/amcss.c +++ b/mps/code/amcss.c @@ -95,13 +95,12 @@ static void report(void) static mps_addr_t make(size_t rootsCount) { - static unsigned long calls = 0; + static volatile unsigned long calls = 0; /* for use from debugger */ size_t length = rnd() % (scale * avLEN); size_t size = (length+2) * sizeof(mps_word_t); mps_addr_t p; mps_res_t res; ++ calls; - (void)calls; /* suppress unused warning: we want to look at this from debugger */ do { MPS_RESERVE_BLOCK(res, p, ap, size);