]> granicus.if.org Git - gc/commitdiff
Fix printf arguments type in print_callers
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 Aug 2017 22:17:08 +0000 (01:17 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 29 Sep 2017 21:03:33 +0000 (00:03 +0300)
* 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.

os_dep.c

index 4cc0e6abb36fe08a2a3e01ee4fe96ad31c5dedc3..68140027cce1d8d6408b47f02dde555cd3f8e53e 100644 (file)
--- 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)