From: Ivan Maidanski Date: Tue, 29 Aug 2017 22:17:08 +0000 (+0300) Subject: Fix printf arguments type in print_callers X-Git-Tag: v7.4.6~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ab827ea263d4b54d776e064cdfb841981492aae;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 4cc0e6ab..68140027 100644 --- a/os_dep.c +++ b/os_dep.c @@ -4654,7 +4654,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; } { @@ -4666,7 +4667,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)