From: Ivan Maidanski Date: Tue, 29 Aug 2017 22:17:08 +0000 (+0300) Subject: Fix printf arguments type in print_callers X-Git-Tag: v8.0.0~589 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa406bd7dd2106b2bf9a51edaabc2ce65a22c95d;p=gc Fix printf arguments type in print_callers * os_dep.c [NEED_CALLINFO] (GC_print_callers): Cast info[i].ci_pc to unsigned long in GC_err_printf call to match the format specifier. --- diff --git a/os_dep.c b/os_dep.c index 2fc10f3b..49e2f573 100644 --- a/os_dep.c +++ b/os_dep.c @@ -4619,7 +4619,8 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]) if (reentry_count > 1) { /* We were called during an allocation during */ /* a previous GC_print_callers call; punt. */ - GC_err_printf("\t\t##PC##= 0x%lx\n", info[i].ci_pc); + GC_err_printf("\t\t##PC##= 0x%lx\n", + (unsigned long)info[i].ci_pc); continue; } { @@ -4631,7 +4632,8 @@ GC_INNER void GC_print_callers(struct callinfo info[NFRAMES]) # else char buf[40]; char *name = buf; - (void)snprintf(buf, sizeof(buf), "##PC##= 0x%lx", info[i].ci_pc); + (void)snprintf(buf, sizeof(buf), "##PC##= 0x%lx", + (unsigned long)info[i].ci_pc); buf[sizeof(buf) - 1] = '\0'; # endif # if defined(LINUX) && !defined(SMALL_CONFIG)