]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 5 Aug 2015 21:16:09 +0000 (21:16 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 5 Aug 2015 21:16:09 +0000 (21:16 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15499

14 files changed:
coregrind/m_addrinfo.c
coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_errormgr.c
coregrind/m_hashtable.c
coregrind/m_initimg/initimg-linux.c
coregrind/m_libcassert.c
coregrind/m_machine.c
coregrind/m_main.c
coregrind/m_mallocfree.c
coregrind/m_sbprofile.c
coregrind/m_signals.c
coregrind/m_stacktrace.c
coregrind/m_translate.c
coregrind/m_transtab.c

index 5ff0d28960277f6f8e56c8138355d290a41f38e5..fd27d6015206df32019af54de24e4b3bce93d8a4 100644 (file)
@@ -420,22 +420,21 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
 
       case Addr_Unknown:
          if (maybe_gcc) {
-            VG_(emit)( "%sAddress 0x%llx is just below the stack ptr.  "
+            VG_(emit)( "%sAddress 0x%lx is just below the stack ptr.  "
                        "To suppress, use: --workaround-gcc296-bugs=yes%s\n",
-                       xpre, (ULong)a, xpost );
+                       xpre, a, xpost );
         } else {
-            VG_(emit)( "%sAddress 0x%llx "
+            VG_(emit)( "%sAddress 0x%lx "
                        "is not stack'd, malloc'd or %s%s\n",
-                       xpre, 
-                       (ULong)a, 
+                       xpre, a,
                        mc ? "(recently) free'd" : "on a free list",
                        xpost );
          }
          break;
 
       case Addr_Stack: 
-         VG_(emit)( "%sAddress 0x%llx is on thread %s%d's stack%s\n", 
-                    xpre, (ULong)a, 
+         VG_(emit)( "%sAddress 0x%lx is on thread %s%u's stack%s\n", 
+                    xpre, a, 
                     opt_tnr_prefix (ai->Addr.Stack.tinfo), 
                     tnr_else_tid (ai->Addr.Stack.tinfo), 
                     xpost );
@@ -459,7 +458,7 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
 
             HChar strlinenum[16] = "";   // large enough
             if (hasfile && haslinenum)
-               VG_(sprintf)(strlinenum, "%d", linenum);
+               VG_(sprintf)(strlinenum, "%u", linenum);
 
             hasfn = VG_(get_fnname)(ai->Addr.Stack.IP, &fn);
 
@@ -563,7 +562,7 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
          }
          if (ai->Addr.Block.alloc_tinfo.tnr || ai->Addr.Block.alloc_tinfo.tid)
             VG_(emit)(
-               "%sBlock was alloc'd by thread %s%d%s\n",
+               "%sBlock was alloc'd by thread %s%u%s\n",
                xpre,
                opt_tnr_prefix (ai->Addr.Block.alloc_tinfo),
                tnr_else_tid (ai->Addr.Block.alloc_tinfo),
@@ -573,10 +572,9 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
       }
 
       case Addr_DataSym:
-         VG_(emit)( "%sAddress 0x%llx is %llu bytes "
+         VG_(emit)( "%sAddress 0x%lx is %llu bytes "
                     "inside data symbol \"%pS\"%s\n",
-                    xpre,
-                    (ULong)a,
+                    xpre, a,
                     (ULong)ai->Addr.DataSym.offset,
                     ai->Addr.DataSym.name,
                     xpost );
@@ -597,9 +595,8 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
          break;
 
       case Addr_SectKind:
-         VG_(emit)( "%sAddress 0x%llx is in the %pS segment of %pS%s\n",
-                    xpre,
-                    (ULong)a,
+         VG_(emit)( "%sAddress 0x%lx is in the %pS segment of %pS%s\n",
+                    xpre, a,
                     VG_(pp_SectKind)(ai->Addr.SectKind.kind),
                     ai->Addr.SectKind.objname,
                     xpost );
@@ -612,29 +609,27 @@ static void pp_addrinfo_WRK ( Addr a, const AddrInfo* ai, Bool mc,
 
       case Addr_BrkSegment:
          if (a < ai->Addr.BrkSegment.brk_limit)
-            VG_(emit)( "%sAddress 0x%llx is in the brk data segment"
-                       " 0x%llx-0x%llx%s\n",
-                       xpre,
-                       (ULong)a,
-                       (ULong)VG_(brk_base),
-                       (ULong)ai->Addr.BrkSegment.brk_limit - 1,
+            VG_(emit)( "%sAddress 0x%lx is in the brk data segment"
+                       " 0x%lx-0x%lx%s\n",
+                       xpre, a,
+                       VG_(brk_base),
+                       ai->Addr.BrkSegment.brk_limit - 1,
                        xpost );
          else
-            VG_(emit)( "%sAddress 0x%llx is %lu bytes after "
+            VG_(emit)( "%sAddress 0x%lx is %lu bytes after "
                        "the brk data segment limit"
-                       " 0x%llx%s\n",
-                       xpre,
-                       (ULong)a,
+                       " 0x%lx%s\n",
+                       xpre, a,
                        a - ai->Addr.BrkSegment.brk_limit,
-                       (ULong)ai->Addr.BrkSegment.brk_limit,
+                       ai->Addr.BrkSegment.brk_limit,
                        xpost );
          break;
 
       case Addr_SegmentKind:
-         VG_(emit)( "%sAddress 0x%llx is in "
+         VG_(emit)( "%sAddress 0x%lx is in "
                     "a %s%s%s %s%s%pS segment%s\n",
                     xpre,
-                    (ULong)a,
+                    a,
                     ai->Addr.SegmentKind.hasR ? "r" : "-",
                     ai->Addr.SegmentKind.hasW ? "w" : "-",
                     ai->Addr.SegmentKind.hasX ? "x" : "-",
index 9fe0dff4190a93db1cef4bd57a3c108347417ea4..9da5aaf2c9a94653a10c2b16eff961ae85076549 100644 (file)
@@ -442,10 +442,10 @@ static void show_nsegment_full ( Int logLevel, Int segNo, const NSegment* seg )
 
    VG_(debugLog)(
       logLevel, "aspacem",
-      "%3d: %s %010llx-%010llx %s %c%c%c%c%c %s "
-      "d=0x%03llx i=%-7lld o=%-7lld (%d,%d) %s\n",
+      "%3d: %s %010lx-%010lx %s %c%c%c%c%c %s "
+      "d=0x%03llx i=%-7llu o=%-7lld (%d,%d) %s\n",
       segNo, show_SegKind(seg->kind),
-      (ULong)seg->start, (ULong)seg->end, len_buf,
+      seg->start, seg->end, len_buf,
       seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-', 
       seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',
       seg->isCH ? 'H' : '-',
@@ -469,18 +469,18 @@ static void show_nsegment ( Int logLevel, Int segNo, const NSegment* seg )
       case SkFree:
          VG_(debugLog)(
             logLevel, "aspacem",
-            "%3d: %s %010llx-%010llx %s\n",
+            "%3d: %s %010lx-%010lx %s\n",
             segNo, show_SegKind(seg->kind),
-            (ULong)seg->start, (ULong)seg->end, len_buf
+            seg->start, seg->end, len_buf
          );
          break;
 
       case SkAnonC: case SkAnonV: case SkShmC:
          VG_(debugLog)(
             logLevel, "aspacem",
-            "%3d: %s %010llx-%010llx %s %c%c%c%c%c\n",
+            "%3d: %s %010lx-%010lx %s %c%c%c%c%c\n",
             segNo, show_SegKind(seg->kind),
-            (ULong)seg->start, (ULong)seg->end, len_buf,
+            seg->start, seg->end, len_buf,
             seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-', 
             seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-',
             seg->isCH ? 'H' : '-'
@@ -490,10 +490,10 @@ static void show_nsegment ( Int logLevel, Int segNo, const NSegment* seg )
       case SkFileC: case SkFileV:
          VG_(debugLog)(
             logLevel, "aspacem",
-            "%3d: %s %010llx-%010llx %s %c%c%c%c%c d=0x%03llx "
-            "i=%-7lld o=%-7lld (%d,%d)\n",
+            "%3d: %s %010lx-%010lx %s %c%c%c%c%c d=0x%03llx "
+            "i=%-7llu o=%-7lld (%d,%d)\n",
             segNo, show_SegKind(seg->kind),
-            (ULong)seg->start, (ULong)seg->end, len_buf,
+            seg->start, seg->end, len_buf,
             seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-', 
             seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-', 
             seg->isCH ? 'H' : '-',
@@ -505,9 +505,9 @@ static void show_nsegment ( Int logLevel, Int segNo, const NSegment* seg )
       case SkResvn:
          VG_(debugLog)(
             logLevel, "aspacem",
-            "%3d: %s %010llx-%010llx %s %c%c%c%c%c %s\n",
+            "%3d: %s %010lx-%010lx %s %c%c%c%c%c %s\n",
             segNo, show_SegKind(seg->kind),
-            (ULong)seg->start, (ULong)seg->end, len_buf,
+            seg->start, seg->end, len_buf,
             seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-', 
             seg->hasX ? 'x' : '-', seg->hasT ? 'T' : '-', 
             seg->isCH ? 'H' : '-',
@@ -915,9 +915,9 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot,
               "segment mismatch: V's seg 1st, kernel's 2nd:\n");
          show_nsegment_full( 0, i, &nsegments[i] );
          VG_(debugLog)(0,"aspacem", 
-            "...: .... %010llx-%010llx %s %c%c%c.. ....... "
-            "d=0x%03llx i=%-7lld o=%-7lld (.) m=. %s\n",
-            (ULong)start, (ULong)end, len_buf,
+            "...: .... %010lx-%010lx %s %c%c%c.. ....... "
+            "d=0x%03llx i=%-7llu o=%-7lld (.) m=. %s\n",
+            start, end, len_buf,
             prot & VKI_PROT_READ  ? 'r' : '-',
             prot & VKI_PROT_WRITE ? 'w' : '-',
             prot & VKI_PROT_EXEC  ? 'x' : '-',
@@ -982,8 +982,8 @@ static void sync_check_gap_callback ( Addr addr, SizeT len )
               "segment mismatch: V's gap 1st, kernel's 2nd:\n");
          show_nsegment_full( 0, i, &nsegments[i] );
          VG_(debugLog)(0,"aspacem", 
-            "   : .... %010llx-%010llx %s\n",
-            (ULong)start, (ULong)end, len_buf);
+            "   : .... %010lx-%010lx %s\n",
+            start, end, len_buf);
          return;
       }
    }
@@ -1712,8 +1712,8 @@ Addr VG_(am_startup) ( Addr sp_at_startup )
       accordingly. */
 
    VG_(debugLog)(2, "aspacem", 
-                    "        sp_at_startup = 0x%010llx (supplied)\n", 
-                    (ULong)sp_at_startup );
+                    "        sp_at_startup = 0x%010lx (supplied)\n", 
+                    sp_at_startup );
 
 #  if VG_WORDSIZE == 8
      aspacem_maxAddr = (Addr)0x1000000000ULL - 1; // 64G
@@ -1746,20 +1746,20 @@ Addr VG_(am_startup) ( Addr sp_at_startup )
    aspacem_assert(VG_IS_PAGE_ALIGNED(suggested_clstack_end + 1));
 
    VG_(debugLog)(2, "aspacem", 
-                    "              minAddr = 0x%010llx (computed)\n", 
-                    (ULong)aspacem_minAddr);
+                    "              minAddr = 0x%010lx (computed)\n", 
+                    aspacem_minAddr);
    VG_(debugLog)(2, "aspacem", 
-                    "              maxAddr = 0x%010llx (computed)\n", 
-                    (ULong)aspacem_maxAddr);
+                    "              maxAddr = 0x%010lx (computed)\n", 
+                    aspacem_maxAddr);
    VG_(debugLog)(2, "aspacem", 
-                    "               cStart = 0x%010llx (computed)\n", 
-                    (ULong)aspacem_cStart);
+                    "               cStart = 0x%010lx (computed)\n", 
+                    aspacem_cStart);
    VG_(debugLog)(2, "aspacem", 
-                    "               vStart = 0x%010llx (computed)\n", 
-                    (ULong)aspacem_vStart);
+                    "               vStart = 0x%010lx (computed)\n", 
+                    aspacem_vStart);
    VG_(debugLog)(2, "aspacem", 
-                    "suggested_clstack_end = 0x%010llx (computed)\n", 
-                    (ULong)suggested_clstack_end);
+                    "suggested_clstack_end = 0x%010lx (computed)\n", 
+                    suggested_clstack_end);
 
    if (aspacem_cStart > Addr_MIN) {
       init_resvn(&seg, Addr_MIN, aspacem_cStart-1);
@@ -1881,8 +1881,8 @@ Addr VG_(am_get_advisory) ( const MapRequest*  req,
 
    if (0) {
       VG_(am_show_nsegments)(0,"getAdvisory");
-      VG_(debugLog)(0,"aspacem", "getAdvisory 0x%llx %lld\n", 
-                      (ULong)req->start, (ULong)req->len);
+      VG_(debugLog)(0,"aspacem", "getAdvisory 0x%lx %lu\n",
+                    req->start, req->len);
    }
 
    /* Reject zero-length requests */
index bf510a303a7f518c8d9d8936935ec322094bf436..ec469a0ae5723a5c2b1e443a4630448a6c31ec5a 100644 (file)
@@ -307,7 +307,7 @@ static Bool eq_Error ( VgRes res, const Error* e1, const Error* e2 )
          } else {
             VG_(printf)("\nUnhandled error type: %u. VG_(needs).tool_errors\n"
                         "probably needs to be set.\n",
-                        e1->ekind);
+                        (UInt)e1->ekind);
             VG_(core_panic)("unhandled error type");
          }
    }
@@ -591,7 +591,7 @@ static void pp_Error ( const Error* err, Bool allow_db_attach, Bool xml )
       /* standard preamble */
       VG_(printf_xml)("<error>\n");
       VG_(printf_xml)("  <unique>0x%x</unique>\n", err->unique);
-      VG_(printf_xml)("  <tid>%d</tid>\n", err->tid);
+      VG_(printf_xml)("  <tid>%u</tid>\n", err->tid);
       ThreadState* tst = VG_(get_ThreadState)(err->tid);
       if (tst->thread_name) {
          VG_(printf_xml)("  <threadname>%s</threadname>\n", tst->thread_name);
@@ -617,9 +617,9 @@ static void pp_Error ( const Error* err, Bool allow_db_attach, Bool xml )
           && err->tid > 0 && err->tid != last_tid_printed) {
          ThreadState* tst = VG_(get_ThreadState)(err->tid);
          if (tst->thread_name) {
-            VG_(umsg)("Thread %d %s:\n", err->tid, tst->thread_name );
+            VG_(umsg)("Thread %u %s:\n", err->tid, tst->thread_name );
          } else {
-            VG_(umsg)("Thread %d:\n", err->tid );
+            VG_(umsg)("Thread %u:\n", err->tid );
          }
          last_tid_printed = err->tid;
       }
@@ -981,7 +981,7 @@ void VG_(show_all_errors) (  Int verbosity, Bool xml )
 
    /* We only get here if not printing XML. */
    VG_(umsg)("ERROR SUMMARY: "
-             "%d errors from %d contexts (suppressed: %d from %d)\n",
+             "%u errors from %u contexts (suppressed: %u from %u)\n",
              n_errs_found, n_err_contexts, 
              n_errs_suppressed, n_supp_contexts );
 
@@ -1009,7 +1009,7 @@ void VG_(show_all_errors) (  Int verbosity, Bool xml )
       if (p_min == NULL) continue; //VG_(core_panic)("show_all_errors()");
 
       VG_(umsg)("\n");
-      VG_(umsg)("%d errors in context %d of %d:\n",
+      VG_(umsg)("%d errors in context %d of %u:\n",
                 p_min->count, i+1, n_err_contexts);
       pp_Error( p_min, False/*allow_db_attach*/, False /* xml */ );
 
@@ -1041,7 +1041,7 @@ void VG_(show_all_errors) (  Int verbosity, Bool xml )
    // reprint this, so users don't have to scroll way up to find
    // the first printing
    VG_(umsg)("ERROR SUMMARY: "
-             "%d errors from %d contexts (suppressed: %d from %d)\n",
+             "%u errors from %u contexts (suppressed: %u from %u)\n",
              n_errs_found, n_err_contexts, n_errs_suppressed,
              n_supp_contexts );
 }
@@ -1891,7 +1891,7 @@ Bool supp_matches_error(const Supp* su, const Error* err)
             VG_(printf)(
                "\nUnhandled suppression type: %u.  VG_(needs).tool_errors\n"
                "probably needs to be set.\n",
-               err->ekind);
+               (UInt)err->ekind);
             VG_(core_panic)("unhandled suppression type");
          }
    }
index 32219c95608988ee2af22f85957d3e980e2c5972..dee89631f73654ab509cf2473caaad8c7171f095 100644 (file)
@@ -308,7 +308,7 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp )
           || key_occurences[i] > 0 
           || cno_occurences[i] > 0)
          VG_(message)(Vg_DebugMsg,
-                      "%s=%2d : nr chain %6d, nr keys %6d, nr elts %6d\n",
+                      "%s=%2u : nr chain %6u, nr keys %6u, nr elts %6u\n",
                       i == MAXOCCUR ? ">" : "N", i,
                       cno_occurences[i], key_occurences[i], elt_occurences[i]);
       nkey += key_occurences[i];
@@ -316,7 +316,7 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp )
       ncno += cno_occurences[i];
    }
    VG_(message)(Vg_DebugMsg, 
-                "total nr of unique   slots: %6d, keys %6d, elts %6d."
+                "total nr of unique   slots: %6u, keys %6u, elts %6u."
                 " Avg chain len %3.1f\n",
                 ncno, nkey, nelt,
                 (Double)nelt/(Double)(ncno == cno_occurences[0] ?
index d8ff159cca7513b267feacf4f8c7af15882c6582..d84191cf5fc4324ebf71ce1cfe7dc19e51298d0a 100644 (file)
@@ -478,7 +478,7 @@ Addr setup_client_stack( void*  init_sp,
       auxsize +                               /* auxv */
       VG_ROUNDUP(stringsize, sizeof(Word));   /* strings (aligned) */
 
-   if (0) VG_(printf)("stacksize = %d\n", stacksize);
+   if (0) VG_(printf)("stacksize = %u\n", stacksize);
 
    /* client_SP is the client's stack pointer */
    client_SP = clstack_end - stacksize;
@@ -494,10 +494,10 @@ Addr setup_client_stack( void*  init_sp,
    clstack_max_size = VG_PGROUNDUP(clstack_max_size);
 
    if (0)
-      VG_(printf)("stringsize=%d auxsize=%d stacksize=%d maxsize=0x%x\n"
+      VG_(printf)("stringsize=%u auxsize=%u stacksize=%u maxsize=0x%lx\n"
                   "clstack_start %p\n"
                   "clstack_end   %p\n",
-                 stringsize, auxsize, stacksize, (Int)clstack_max_size,
+                  stringsize, auxsize, stacksize, clstack_max_size,
                   (void*)clstack_start, (void*)clstack_end);
 
    /* ==================== allocate space ==================== */
@@ -815,7 +815,7 @@ Addr setup_client_stack( void*  init_sp,
          default:
             /* stomp out anything we don't know about */
             VG_(debugLog)(2, "initimg",
-                             "stomping auxv entry %lld\n", 
+                             "stomping auxv entry %llu\n", 
                              (ULong)auxv->a_type);
             auxv->a_type = AT_IGNORE;
             break;
@@ -960,7 +960,7 @@ IIFinaliseImageInfo VG_(ii_create_image)( IICreateImageInfo iicii,
       if (szB < m1) szB = m1;
       szB = VG_PGROUNDUP(szB);
       VG_(debugLog)(1, "initimg",
-                       "Setup client stack: size will be %ld\n", szB);
+                       "Setup client stack: size will be %lu\n", szB);
 
       iifii.clstack_max_size = szB;
 
@@ -980,9 +980,9 @@ IIFinaliseImageInfo VG_(ii_create_image)( IICreateImageInfo iicii,
                        (void*)VG_(brk_base) );
       VG_(debugLog)(2, "initimg",
                        "Client info: "
-                       "initial_SP=%p max_stack_size=%ld\n",
+                       "initial_SP=%p max_stack_size=%lu\n",
                        (void*)(iifii.initial_client_SP),
-                       (SizeT)iifii.clstack_max_size );
+                       iifii.clstack_max_size );
    }
 
    //--------------------------------------------------------------
index 0545205a98959545b0a00a841327b2b15be2528e..2d45838a9ec1117480348b7c2f234f7d0a716c1a 100644 (file)
@@ -362,7 +362,7 @@ static void show_sched_status_wrk ( Bool host_stacktrace,
    }
 
    VG_(printf)("\nsched status:\n"); 
-   VG_(printf)("  running_tid=%d\n", VG_(get_running_tid)());
+   VG_(printf)("  running_tid=%u\n", VG_(get_running_tid)());
    for (i = 1; i < VG_N_THREADS; i++) {
       VgStack* stack 
          = (VgStack*)VG_(threads)[i].os_state.valgrind_stack_base;
@@ -389,7 +389,7 @@ static void show_sched_status_wrk ( Bool host_stacktrace,
             VG_(printf)("client stack range: ???????\n");
       }
       if (stack_usage && stack != 0)
-          VG_(printf)("valgrind stack top usage: %ld of %ld\n",
+          VG_(printf)("valgrind stack top usage: %lu of %lu\n",
                       VG_(clo_valgrind_stacksize)
                         - VG_(am_get_VgStack_unused_szB)
                                (stack, VG_(clo_valgrind_stacksize)),
index 87473c6c3e4c9a31f883268b4dc6b5c807196d3b..1c1d4b5a36d7e2ac0c76425d99c1d005261ae436 100644 (file)
@@ -191,7 +191,7 @@ static void apply_to_GPs_of_tid(ThreadId tid, void (*f)(ThreadId,
                                                         const HChar*, Addr))
 {
    VexGuestArchState* vex = &(VG_(get_ThreadState)(tid)->arch.vex);
-   VG_(debugLog)(2, "machine", "apply_to_GPs_of_tid %d\n", tid);
+   VG_(debugLog)(2, "machine", "apply_to_GPs_of_tid %u\n", tid);
 #if defined(VGA_x86)
    (*f)(tid, "EAX", vex->guest_EAX);
    (*f)(tid, "ECX", vex->guest_ECX);
index a8426913903d1fa5f7846e0fee29c30e07887f3c..0ce771c5bcc6655bf4078c9827eb0185b144ebcd 100644 (file)
@@ -1532,8 +1532,8 @@ static void setup_file_descriptors(void)
 #  endif
 
    if (show)
-      VG_(printf)("fd limits: host, before: cur %lu max %lu\n", 
-                  (UWord)rl.rlim_cur, (UWord)rl.rlim_max);
+      VG_(printf)("fd limits: host, before: cur %llu max %llu\n", 
+                  (ULong)rl.rlim_cur, (ULong)rl.rlim_max);
 
    /* Work out where to move the soft limit to. */
    if (rl.rlim_cur + N_RESERVED_FDS <= rl.rlim_max) {
@@ -1552,7 +1552,7 @@ static void setup_file_descriptors(void)
    if (show) {
       VG_(printf)("fd limits: host,  after: cur %lu max %lu\n",
                   (UWord)rl.rlim_cur, (UWord)rl.rlim_max);
-      VG_(printf)("fd limits: guest       : cur %u max %u\n",
+      VG_(printf)("fd limits: guest       : cur %d max %d\n",
                   VG_(fd_soft_limit), VG_(fd_hard_limit));
    }
 
@@ -2698,7 +2698,7 @@ void shutdown_actions_NORETURN( ThreadId tid,
       sys_exit, do likewise; if the (last) thread stopped due to a fatal
       signal, terminate the entire system with that same fatal signal. */
    VG_(debugLog)(1, "core_os", 
-                    "VG_(terminate_NORETURN)(tid=%lld)\n", (ULong)tid);
+                    "VG_(terminate_NORETURN)(tid=%u)\n", tid);
 
    switch (tids_schedretcode) {
    case VgSrc_ExitThread:  /* the normal way out (Linux, Solaris) */
index 42f029c8f0977f5a9fb5435a42c19b335f129374..b8e994cab8059396cbdddbdb54da6d31bb58a40f 100644 (file)
@@ -877,7 +877,7 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB )
    if (a->stats__bytes_mmaped > a->stats__bytes_mmaped_max)
       a->stats__bytes_mmaped_max = a->stats__bytes_mmaped;
    VG_(debugLog)(1, "mallocfree",
-                    "newSuperblock at %p (pszB %7ld) %s owner %s/%s\n", 
+                    "newSuperblock at %p (pszB %7lu) %s owner %s/%s\n", 
                     sb, sb->n_payload_bytes,
                     (unsplittable ? "unsplittable" : ""),
                     a->clientmem ? "CLIENT" : "VALGRIND", a->name );
@@ -895,7 +895,7 @@ void reclaimSuperblock ( Arena* a, Superblock* sb)
    UInt   i, j;
 
    VG_(debugLog)(1, "mallocfree",
-                    "reclaimSuperblock at %p (pszB %7ld) %s owner %s/%s\n", 
+                    "reclaimSuperblock at %p (pszB %7lu) %s owner %s/%s\n", 
                     sb, sb->n_payload_bytes,
                     (sb->unsplittable ? "unsplittable" : ""),
                     a->clientmem ? "CLIENT" : "VALGRIND", a->name );
@@ -1220,13 +1220,13 @@ void ppSuperblocks ( Arena* a )
       Superblock * sb = a->sblocks[j];
 
       VG_(printf)( "\n" );
-      VG_(printf)( "superblock %d at %p %s, sb->n_pl_bs = %lu\n",
+      VG_(printf)( "superblock %u at %p %s, sb->n_pl_bs = %lu\n",
                    blockno++, sb, (sb->unsplittable ? "unsplittable" : ""),
                    sb->n_payload_bytes);
       for (i = 0; i < sb->n_payload_bytes; i += b_bszB) {
          Block* b = (Block*)&sb->payload_bytes[i];
          b_bszB   = get_bszB(b);
-         VG_(printf)( "   block at %d, bszB %lu: ", i, b_bszB );
+         VG_(printf)( "   block at %u, bszB %lu: ", i, b_bszB );
          VG_(printf)( "%s, ", is_inuse_block(b) ? "inuse" : "free");
          VG_(printf)( "%s\n", blockSane(a, b) ? "ok" : "BAD" );
       }
@@ -1276,13 +1276,13 @@ static void sanity_check_malloc_arena ( ArenaId aid )
          b     = (Block*)&sb->payload_bytes[i];
          b_bszB = get_bszB_as_is(b);
          if (!blockSane(a, b)) {
-            VG_(printf)("sanity_check_malloc_arena: sb %p, block %d "
+            VG_(printf)("sanity_check_malloc_arena: sb %p, block %u "
                         "(bszB %lu):  BAD\n", sb, i, b_bszB );
             BOMB;
          }
          thisFree = !is_inuse_block(b);
          if (thisFree && lastWasFree) {
-            VG_(printf)("sanity_check_malloc_arena: sb %p, block %d "
+            VG_(printf)("sanity_check_malloc_arena: sb %p, block %u "
                         "(bszB %lu): UNMERGED FREES\n", sb, i, b_bszB );
             BOMB;
          }
@@ -1323,7 +1323,7 @@ static void sanity_check_malloc_arena ( ArenaId aid )
          b_prev = b;
          b = get_next_b(b);
          if (get_prev_b(b) != b_prev) {
-            VG_(printf)( "sanity_check_malloc_arena: list %d at %p: "
+            VG_(printf)( "sanity_check_malloc_arena: list %u at %p: "
                          "BAD LINKAGE\n",
                          listno, b );
             BOMB;
@@ -1331,7 +1331,7 @@ static void sanity_check_malloc_arena ( ArenaId aid )
          b_pszB = get_pszB(a, b);
          if (b_pszB < list_min_pszB || b_pszB > list_max_pszB) {
             VG_(printf)(
-               "sanity_check_malloc_arena: list %d at %p: "
+               "sanity_check_malloc_arena: list %u at %p: "
                "WRONG CHAIN SIZE %luB (%luB, %luB)\n",
                listno, b, b_pszB, list_min_pszB, list_max_pszB );
             BOMB;
@@ -1353,8 +1353,8 @@ static void sanity_check_malloc_arena ( ArenaId aid )
 
    if (VG_(clo_verbosity) > 2) 
       VG_(message)(Vg_DebugMsg,
-                   "%-8s: %2d sbs, %5d bs, %2d/%-2d free bs, "
-                   "%7ld mmap, %7ld loan\n",
+                   "%-8s: %2u sbs, %5u bs, %2u/%-2u free bs, "
+                   "%7lu mmap, %7lu loan\n",
                    a->name,
                    superblockctr,
                    blockctr_sb, blockctr_sb_free, blockctr_li, 
@@ -1764,7 +1764,7 @@ void* VG_(arena_malloc) ( ArenaId aid, const HChar* cc, SizeT req_pszB )
       a->sblocks_size *= 2;
       a->sblocks = array;
       VG_(debugLog)(1, "mallocfree", 
-                       "sblock array for arena `%s' resized to %ld\n", 
+                       "sblock array for arena `%s' resized to %lu\n", 
                        a->name, a->sblocks_size);
    }
 
@@ -1892,7 +1892,7 @@ void deferred_reclaimSuperblock ( Arena* a, Superblock* sb)
                     a->clientmem ? "CLIENT" : "VALGRIND", a->name );
    } else
       VG_(debugLog)(1, "mallocfree",
-                    "deferred_reclaimSuperblock at %p (pszB %7ld) %s "
+                    "deferred_reclaimSuperblock at %p (pszB %7lu) %s "
                     "(prev %p) owner %s/%s\n",
                     sb, sb->n_payload_bytes,
                     (sb->unsplittable ? "unsplittable" : ""),
@@ -2457,8 +2457,8 @@ void VG_(arena_realloc_shrink) ( ArenaId aid,
 
          sb->n_payload_bytes -= frag_bszB;
          VG_(debugLog)(1, "mallocfree",
-                       "shrink superblock %p to (pszB %7ld) "
-                       "owner %s/%s (munmap-ing %p %7ld)\n",
+                       "shrink superblock %p to (pszB %7lu) "
+                       "owner %s/%s (munmap-ing %p %7lu)\n",
                        sb, sb->n_payload_bytes,
                        a->clientmem ? "CLIENT" : "VALGRIND", a->name,
                        (void*) frag, frag_bszB);
index f64260fc22144d3495e0011373156b0edbef3373..0b8022ba14759cb6726064d8754c01a1702881ee 100644 (file)
@@ -72,7 +72,7 @@ void show_SB_profile ( const SBProfEntry tops[], UInt n_tops,
    VG_(printf)("<<<\n");
    VG_(printf)("\n");
 
-   VG_(printf)("Total score = %'lld\n\n", score_total);
+   VG_(printf)("Total score = %'llu\n\n", score_total);
 
    /* Print an initial per-block summary. */
    VG_(printf)("rank  ---cumulative---      -----self-----\n");
@@ -96,7 +96,7 @@ void show_SB_profile ( const SBProfEntry tops[], UInt n_tops,
       Double percent_here =
          score_total == 0 ? 100.0 : score_here * 100.0 / score_total;
         
-      VG_(printf)("%3d: (%9lld %5.2f%%)   %9lld %5.2f%%      0x%lx %s\n",
+      VG_(printf)("%3d: (%9llu %5.2f%%)   %9llu %5.2f%%      0x%lx %s\n",
                   r,
                   score_cumul, percent_cumul,
                   score_here,  percent_here, tops[r].addr, name);
@@ -138,7 +138,7 @@ void show_SB_profile ( const SBProfEntry tops[], UInt n_tops,
          VG_(printf)("\n");
          VG_(printf)("=-=-=-=-=-=-=-=-=-=-=-=-=-= begin SB rank %d "
                      "=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n", r);
-         VG_(printf)("%3d: (%9lld %5.2f%%)   %9lld %5.2f%%      0x%lx %s\n",
+         VG_(printf)("%3d: (%9llu %5.2f%%)   %9llu %5.2f%%      0x%lx %s\n",
                      r,
                      score_cumul, percent_cumul,
                      score_here,  percent_here, tops[r].addr, name );
@@ -170,7 +170,7 @@ void show_SB_profile ( const SBProfEntry tops[], UInt n_tops,
          Double percent_here =
            score_total == 0 ? 100.0 : score_here * 100.0 / score_total;
 
-         VG_(printf)("%3d: (%9lld %5.2f%%)   %9lld %5.2f%%      0x%lx %s\n",
+         VG_(printf)("%3d: (%9llu %5.2f%%)   %9llu %5.2f%%      0x%lx %s\n",
                      r,
                      score_cumul, percent_cumul,
                      score_here,  percent_here, tops[r].addr, name );
index d80cfc9a1fec3cb07f8a8065d2ded54bb1f81607..f59bff7d2cb4c1c65c5fc92ccaa7d70933dc29a7 100644 (file)
@@ -1145,7 +1145,7 @@ SysRes VG_(do_sys_sigaltstack) ( ThreadId tid, vki_stack_t* ss, vki_stack_t* oss
    m_SP  = VG_(get_SP)(tid);
 
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("sys_sigaltstack: tid %d, "
+      VG_(dmsg)("sys_sigaltstack: tid %u, "
                 "ss %p{%p,sz=%llu,flags=0x%llx}, oss %p (current SP %p)\n",
                 tid, (void*)ss, 
                 ss ? ss->ss_sp : 0,
@@ -1339,7 +1339,7 @@ void do_setmask ( ThreadId tid,
                  vki_sigset_t* oldset )
 {
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("do_setmask: tid = %d how = %d (%s), newset = %p (%s)\n", 
+      VG_(dmsg)("do_setmask: tid = %u how = %d (%s), newset = %p (%s)\n", 
                 tid, how,
                 how==VKI_SIG_BLOCK ? "SIG_BLOCK" : (
                    how==VKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
@@ -1440,7 +1440,7 @@ void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo,
    tst = & VG_(threads)[tid];
 
    if (VG_(clo_trace_signals)) {
-      VG_(dmsg)("push_signal_frame (thread %d): signal %d\n", tid, sigNo);
+      VG_(dmsg)("push_signal_frame (thread %u): signal %d\n", tid, sigNo);
       VG_(get_and_pp_StackTrace)(tid, 10);
    }
 
@@ -1455,7 +1455,7 @@ void push_signal_frame ( ThreadId tid, const vki_siginfo_t *siginfo,
       esp_top_of_frame 
          = (Addr)(tst->altstack.ss_sp) + tst->altstack.ss_size;
       if (VG_(clo_trace_signals))
-         VG_(dmsg)("delivering signal %d (%s) to thread %d: "
+         VG_(dmsg)("delivering signal %d (%s) to thread %u: "
                    "on ALT STACK (%p-%p; %ld bytes)\n",
                    sigNo, VG_(signame)(sigNo), tid, tst->altstack.ss_sp,
                    (UChar *)tst->altstack.ss_sp + tst->altstack.ss_size,
@@ -1935,7 +1935,7 @@ static void deliver_signal ( ThreadId tid, const vki_siginfo_t *info,
    ThreadState         *tst = VG_(get_ThreadState)(tid);
 
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("delivering signal %d (%s):%d to thread %d\n", 
+      VG_(dmsg)("delivering signal %d (%s):%d to thread %u\n", 
                 sigNo, VG_(signame)(sigNo), info->si_code, tid );
 
    if (sigNo == VG_SIGVGKILL) {
@@ -2195,7 +2195,7 @@ void queue_signal(ThreadId tid, const vki_siginfo_t *si)
    sq = tst->sig_queue;
 
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("Queueing signal %d (idx %d) to thread %d\n",
+      VG_(dmsg)("Queueing signal %d (idx %d) to thread %u\n",
                 si->si_signo, sq->next, tid);
 
    /* Add signal to the queue.  If the queue gets overrun, then old
@@ -2205,7 +2205,7 @@ void queue_signal(ThreadId tid, const vki_siginfo_t *si)
       least a non-siginfo signal gets deliviered.
    */
    if (sq->sigs[sq->next].si_signo != 0)
-      VG_(umsg)("Signal %d being dropped from thread %d's queue\n",
+      VG_(umsg)("Signal %d being dropped from thread %u's queue\n",
                 sq->sigs[sq->next].si_signo, tid);
 
    sq->sigs[sq->next] = *si;
@@ -2243,7 +2243,7 @@ static vki_siginfo_t *next_queued(ThreadId tid, const vki_sigset_t *set)
       if (sq->sigs[idx].si_signo != 0 
           && VG_(sigismember)(set, sq->sigs[idx].si_signo)) {
         if (VG_(clo_trace_signals))
-            VG_(dmsg)("Returning queued signal %d (idx %d) for thread %d\n",
+            VG_(dmsg)("Returning queued signal %d (idx %d) for thread %u\n",
                       sq->sigs[idx].si_signo, idx, tid);
         ret = &sq->sigs[idx];
         goto out;
@@ -2404,7 +2404,7 @@ void async_signalhandler ( Int sigNo,
    info->si_code = sanitize_si_code(info->si_code);
 
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("async signal handler: signal=%d, tid=%d, si_code=%d\n",
+      VG_(dmsg)("async signal handler: signal=%d, tid=%u, si_code=%d\n",
                 sigNo, tid, info->si_code);
 
    /* Update thread state properly.  The signal can only have been
@@ -2513,17 +2513,17 @@ Bool VG_(extend_stack)(ThreadId tid, Addr addr)
    udelta = VG_PGROUNDUP(seg_next->start - addr);
 
    VG_(debugLog)(1, "signals", 
-                    "extending a stack base 0x%llx down by %lld\n",
-                    (ULong)seg_next->start, (ULong)udelta);
+                    "extending a stack base 0x%lx down by %lu\n",
+                    seg_next->start, udelta);
    Bool overflow;
    if (! VG_(am_extend_into_adjacent_reservation_client)
        ( seg_next->start, -(SSizeT)udelta, &overflow )) {
       Addr new_stack_base = seg_next->start - udelta;
       if (overflow)
-         VG_(umsg)("Stack overflow in thread #%d: can't grow stack to %#lx\n",
+         VG_(umsg)("Stack overflow in thread #%u: can't grow stack to %#lx\n",
                    tid, new_stack_base);
       else
-         VG_(umsg)("Cannot map memory to grow the stack for thread #%d "
+         VG_(umsg)("Cannot map memory to grow the stack for thread #%u "
                    "to %#lx\n", tid, new_stack_base);
       return False;
    }
@@ -2664,11 +2664,11 @@ static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info)
 
    if (VG_(clo_trace_signals)) {
       if (seg == NULL)
-         VG_(dmsg)("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+         VG_(dmsg)("SIGSEGV: si_code=%d faultaddr=%#lx tid=%u ESP=%#lx "
                    "seg=NULL\n",
                    info->si_code, fault, tid, esp);
       else
-         VG_(dmsg)("SIGSEGV: si_code=%d faultaddr=%#lx tid=%d ESP=%#lx "
+         VG_(dmsg)("SIGSEGV: si_code=%d faultaddr=%#lx tid=%u ESP=%#lx "
                    "seg=%#lx-%#lx\n",
                    info->si_code, fault, tid, esp, seg->start, seg->end);
    }
@@ -2752,7 +2752,7 @@ void sync_signalhandler_from_kernel ( ThreadId tid,
                 "a signal %d (%s) - exiting\n",
                 sigNo, VG_(signame)(sigNo));
 
-      VG_(dmsg)("si_code=%x;  Faulting address: %p;  sp: %#lx\n",
+      VG_(dmsg)("si_code=%d;  Faulting address: %p;  sp: %#lx\n",
                 info->si_code, info->VKI_SIGINFO_si_addr,
                 VG_UCONTEXT_STACK_PTR(uc));
 
@@ -2846,7 +2846,7 @@ static void sigvgkill_handler(int signo, vki_siginfo_t *si,
    ThreadStatus at_signal = VG_(threads)[tid].status;
 
    if (VG_(clo_trace_signals))
-      VG_(dmsg)("sigvgkill for lwp %d tid %d\n", VG_(gettid)(), tid);
+      VG_(dmsg)("sigvgkill for lwp %d tid %u\n", VG_(gettid)(), tid);
 
    VG_(acquire_BigLock)(tid, "sigvgkill_handler");
 
@@ -2936,7 +2936,7 @@ void VG_(poll_signals)(ThreadId tid)
    /* If there was nothing queued, ask the kernel for a pending signal */
    if (sip == NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
       if (VG_(clo_trace_signals))
-         VG_(dmsg)("poll_signals: got signal %d for thread %d\n",
+         VG_(dmsg)("poll_signals: got signal %d for thread %u\n",
                    si.si_signo, tid);
       sip = &si;
    }
@@ -2944,7 +2944,7 @@ void VG_(poll_signals)(ThreadId tid)
    if (sip != NULL) {
       /* OK, something to do; deliver it */
       if (VG_(clo_trace_signals))
-         VG_(dmsg)("Polling found signal %d for tid %d\n", sip->si_signo, tid);
+         VG_(dmsg)("Polling found signal %d for tid %u\n", sip->si_signo, tid);
       if (!is_sig_ign(sip, tid))
         deliver_signal(tid, sip, NULL);
       else if (VG_(clo_trace_signals))
index 005765ad9dd0853371812e7afe3026448ef95bfa..1471a0b84e61ba216e3a791c7162ca5cfcfb454f 100644 (file)
@@ -225,7 +225,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
       fp_max -= sizeof(Addr);
 
    if (debug)
-      VG_(printf)("max_n_ips=%d fp_min=0x%08lx fp_max_orig=0x08%lx, "
+      VG_(printf)("max_n_ips=%u fp_min=0x%08lx fp_max_orig=0x08%lx, "
                   "fp_max=0x%08lx ip=0x%08lx fp=0x%08lx\n",
                   max_n_ips, fp_min, fp_max_orig, fp_max,
                   uregs.xip, uregs.xbp);
@@ -518,7 +518,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
       fp_max -= sizeof(Addr);
 
    if (debug)
-      VG_(printf)("max_n_ips=%d fp_min=0x%lx fp_max_orig=0x%lx, "
+      VG_(printf)("max_n_ips=%u fp_min=0x%lx fp_max_orig=0x%lx, "
                   "fp_max=0x%lx ip=0x%lx fp=0x%lx\n",
                   max_n_ips, fp_min, fp_max_orig, fp_max,
                   uregs.xip, uregs.xbp);
@@ -1705,9 +1705,9 @@ UInt VG_(get_StackTrace) ( ThreadId tid,
    startRegs.r_pc += (Long)(Word)first_ip_delta;
 
    if (0)
-      VG_(printf)("tid %d: stack_highest=0x%08lx ip=0x%010llx "
+      VG_(printf)("tid %u: stack_highest=0x%08lx ip=0x%010llx "
                   "sp=0x%010llx\n",
-                 tid, stack_highest_byte,
+                  tid, stack_highest_byte,
                   startRegs.r_pc, startRegs.r_sp);
 
    return VG_(get_StackTrace_wrk)(tid, ips, max_n_ips, 
index d277a24cbbb68aef456e521882a63ed42d46c532..ce93b33d1294a39cf11ca91514d1e94f93b9e85a 100644 (file)
@@ -1572,9 +1572,10 @@ Bool VG_(translate) ( ThreadId tid,
       Bool ok = VG_(get_fnname_w_offset)(addr, &fnname);
       if (!ok) fnname = "UNKNOWN_FUNCTION";
       VG_(printf)(
-         "==== SB %d (evchecks %lld) [tid %d] 0x%lx %s %s+0x%llx\n",
-         VG_(get_bbs_translated)(), bbs_done, (Int)tid, addr,
-         fnname, objname, (ULong)objoff
+         "==== SB %u (evchecks %llu) [tid %u] 0x%lx %s %s%c0x%lx\n",
+         VG_(get_bbs_translated)(), bbs_done, tid, addr,
+         fnname, objname, objoff >= 0 ? '+' : '-', 
+         (UWord)(objoff >= 0 ? objoff : -objoff)
       );
    }
 
index a5f6f26fa6140c3116518526e2dbca0b8f64e463..85f9eaaf3667b5e03704a44779832ae21a9101db 100644 (file)
@@ -2373,8 +2373,8 @@ void VG_(init_tt_tc) ( void )
    if (VG_(clo_verbosity) > 2 || VG_(clo_stats)
        || VG_(debugLog_getLevel) () >= 2) {
       VG_(message)(Vg_DebugMsg,
-         "TT/TC: cache: %s--avg-transtab-entry-size=%d, " 
-         "%stool provided default %d\n",
+         "TT/TC: cache: %s--avg-transtab-entry-size=%u, "
+         "%stool provided default %u\n",
          VG_(clo_avg_transtab_entry_size) == 0 ? "ignoring " : "using ",
          VG_(clo_avg_transtab_entry_size),
          VG_(clo_avg_transtab_entry_size) == 0 ? "using " : "ignoring ",
@@ -2426,13 +2426,13 @@ void VG_(print_tt_tc_stats) ( void )
       n_fast_updates, n_fast_flushes );
 
    VG_(message)(Vg_DebugMsg,
-                " transtab: new        %'lld "
+                " transtab: new        %'llu "
                 "(%'llu -> %'llu; ratio %3.1f) [%'llu scs] "
-                "avg tce size %d\n",
+                "avg tce size %llu\n",
                 n_in_count, n_in_osize, n_in_tsize,
                 safe_idiv(n_in_tsize, n_in_osize),
                 n_in_sc_count,
-                (int) (n_in_tsize / (n_in_count ? n_in_count : 1)));
+                n_in_tsize / (n_in_count ? n_in_count : 1));
    VG_(message)(Vg_DebugMsg,
                 " transtab: dumped     %'llu (%'llu -> ?" "?) "
                 "(sectors recycled %'llu)\n",