Skip to content

Commit d92239c

Browse files
committed
Declaring variable as static volatile to ensure clean communication with debugger and suppress warnings. this is a better expression of intention.
1 parent 6651dec commit d92239c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mps/code/amcss.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ static void report(void)
9595

9696
static mps_addr_t make(size_t rootsCount)
9797
{
98-
static unsigned long calls = 0;
98+
static volatile unsigned long calls = 0; /* for use from debugger */
9999
size_t length = rnd() % (scale * avLEN);
100100
size_t size = (length+2) * sizeof(mps_word_t);
101101
mps_addr_t p;
102102
mps_res_t res;
103103
++ calls;
104-
(void)calls; /* suppress unused warning: we want to look at this from debugger */
105104

106105
do {
107106
MPS_RESERVE_BLOCK(res, p, ap, size);

0 commit comments

Comments
 (0)