]> 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>
Tue, 29 Aug 2017 22:17:08 +0000 (01:17 +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 2fc10f3b380dfaf43b0e8cd2c20278a8bbb717a4..49e2f573061199fc3cf94b1332700d19ee92251d 100644 (file)
--- 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)