Skip to content

Commit

Permalink
Eliminate 'mismatching format specifier' gcc warning in print_heap_sects
Browse files Browse the repository at this point in the history
(fix of commit 32b9d86)

* alloc.c [!NO_DEBUGGING] (GC_print_heap_sects): Change printf format
specifier from %d to %u for i variable; cast i variable to unsigned.
  • Loading branch information
ivmai committed Jul 10, 2024
1 parent 32b9d86 commit 1adafe3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,8 +1536,8 @@ STATIC void GC_add_to_heap(struct hblk *h, size_t sz)
for (h = (struct hblk *)start; ADDR_LT((ptr_t)h, start + len); h++) {
if (GC_is_black_listed(h, HBLKSIZE)) nbl++;
}
GC_printf("Section %d from %p to %p %u/%lu blacklisted\n",
i, (void *)start, (void *)&start[len],
GC_printf("Section %u from %p to %p %u/%lu blacklisted\n",
(unsigned)i, (void *)start, (void *)&start[len],
nbl, (unsigned long)divHBLKSZ(len));
}
}
Expand Down

0 comments on commit 1adafe3

Please sign in to comment.