From: Florian Krohm Date: Mon, 3 Aug 2015 21:21:42 +0000 (+0000) Subject: Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness. X-Git-Tag: svn/VALGRIND_3_11_0~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad320523695959a400cfc03656227f6fa0eecc9c;p=thirdparty%2Fvalgrind.git Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15480 --- diff --git a/helgrind/hg_basics.c b/helgrind/hg_basics.c index 4a039c988e..b2a22adbd3 100644 --- a/helgrind/hg_basics.c +++ b/helgrind/hg_basics.c @@ -77,7 +77,7 @@ UWord HG_(clo_history_level) = 2; UWord HG_(clo_conflict_cache_size) = 2000000; -Word HG_(clo_sanity_flags) = 0; +UWord HG_(clo_sanity_flags) = 0; Bool HG_(clo_free_is_write) = False; diff --git a/helgrind/hg_basics.h b/helgrind/hg_basics.h index 41ee803e12..37f29067ca 100644 --- a/helgrind/hg_basics.h +++ b/helgrind/hg_basics.h @@ -101,7 +101,7 @@ extern UWord HG_(clo_conflict_cache_size); /* Sanity check level. This is an or-ing of SCE_{THREADS,LOCKS,BIGRANGE,ACCESS,LAOG}. */ -extern Word HG_(clo_sanity_flags); +extern UWord HG_(clo_sanity_flags); /* Treat heap frees as if the memory was written immediately prior to the free. This shakes out races in which memory is referenced by diff --git a/helgrind/hg_errors.c b/helgrind/hg_errors.c index 49414549e8..e694fb73f8 100644 --- a/helgrind/hg_errors.c +++ b/helgrind/hg_errors.c @@ -1296,7 +1296,7 @@ void HG_(print_access) (StackTrace ips, UInt n_ips, if (threadp->coretid == VG_INVALID_THREADID) VG_(printf)(" tid (exited)\n"); else - VG_(printf)(" tid %d\n", threadp->coretid); + VG_(printf)(" tid %u\n", threadp->coretid); { Lock** locksHeldW_P; locksHeldW_P = enumerate_WordSet_into_LockP_vector( diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 2550613083..76650c05e9 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -520,7 +520,7 @@ static void pp_Lock ( Int d, Lock* lk, if (thr->coretid == VG_INVALID_THREADID) VG_(printf)("tid (exited) "); else - VG_(printf)("tid %d ", thr->coretid); + VG_(printf)("tid %u ", thr->coretid); } } @@ -1037,7 +1037,7 @@ static void shadow_mem_make_New ( Thread* thr, Addr a, SizeT len ) static void shadow_mem_make_NoAccess_NoFX ( Thread* thr, Addr aIN, SizeT len ) { if (0 && len > 500) - VG_(printf)("make NoAccess_NoFX ( %#lx, %ld )\n", aIN, len ); + VG_(printf)("make NoAccess_NoFX ( %#lx, %lu )\n", aIN, len ); // has no effect (NoFX) libhb_srange_noaccess_NoFX( thr->hbthr, aIN, len ); } @@ -1045,7 +1045,7 @@ static void shadow_mem_make_NoAccess_NoFX ( Thread* thr, Addr aIN, SizeT len ) static void shadow_mem_make_NoAccess_AHAE ( Thread* thr, Addr aIN, SizeT len ) { if (0 && len > 500) - VG_(printf)("make NoAccess_AHAE ( %#lx, %ld )\n", aIN, len ); + VG_(printf)("make NoAccess_AHAE ( %#lx, %lu )\n", aIN, len ); // Actually Has An Effect (AHAE) libhb_srange_noaccess_AHAE( thr->hbthr, aIN, len ); } @@ -1053,7 +1053,7 @@ static void shadow_mem_make_NoAccess_AHAE ( Thread* thr, Addr aIN, SizeT len ) static void shadow_mem_make_Untracked ( Thread* thr, Addr aIN, SizeT len ) { if (0 && len > 500) - VG_(printf)("make Untracked ( %#lx, %ld )\n", aIN, len ); + VG_(printf)("make Untracked ( %#lx, %lu )\n", aIN, len ); libhb_srange_untrack( thr->hbthr, aIN, len ); } @@ -5021,7 +5021,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) /* --- --- User-visible client requests --- --- */ case VG_USERREQ__HG_CLEAN_MEMORY: - if (0) VG_(printf)("VG_USERREQ__HG_CLEAN_MEMORY(%#lx,%ld)\n", + if (0) VG_(printf)("VG_USERREQ__HG_CLEAN_MEMORY(%#lx,%lu)\n", args[1], args[2]); /* Call die_mem to (expensively) tidy up properly, if there are any held locks etc in the area. Calling evh__die_mem @@ -5053,7 +5053,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) } case _VG_USERREQ__HG_ARANGE_MAKE_UNTRACKED: - if (0) VG_(printf)("HG_ARANGE_MAKE_UNTRACKED(%#lx,%ld)\n", + if (0) VG_(printf)("HG_ARANGE_MAKE_UNTRACKED(%#lx,%lu)\n", args[1], args[2]); if (args[2] > 0) { /* length */ evh__untrack_mem(args[1], args[2]); @@ -5061,7 +5061,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) break; case _VG_USERREQ__HG_ARANGE_MAKE_TRACKED: - if (0) VG_(printf)("HG_ARANGE_MAKE_TRACKED(%#lx,%ld)\n", + if (0) VG_(printf)("HG_ARANGE_MAKE_TRACKED(%#lx,%lu)\n", args[1], args[2]); if (args[2] > 0) { /* length */ evh__new_mem(args[1], args[2]); @@ -5069,7 +5069,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) break; case _VG_USERREQ__HG_GET_ABITS: - if (0) VG_(printf)("HG_GET_ABITS(%#lx,%#lx,%ld)\n", + if (0) VG_(printf)("HG_GET_ABITS(%#lx,%#lx,%lu)\n", args[1], args[2], args[3]); UChar *zzabit = (UChar *) args[2]; if (zzabit == NULL diff --git a/helgrind/libhb_core.c b/helgrind/libhb_core.c index 96f731c172..f493f67c73 100644 --- a/helgrind/libhb_core.c +++ b/helgrind/libhb_core.c @@ -1503,7 +1503,7 @@ static __attribute__((noinline)) void cacheline_wback ( UWord wix ) sequentialise_CacheLine( csvals, &csvalsUsed, N_LINE_ARANGE, cl ); tl_assert(csvalsUsed >= 1 && csvalsUsed <= N_LINE_ARANGE); - if (0) VG_(printf)("%lu ", csvalsUsed); + if (0) VG_(printf)("%ld ", csvalsUsed); lineZ->dict[0] = lineZ->dict[1] = lineZ->dict[2] = lineZ->dict[3] = SVal_INVALID; @@ -2625,7 +2625,7 @@ static void VTS__show ( const VTS* vts ) n = vts->usedTS; for (i = 0; i < n; i++) { const ScalarTS *st = &vts->ts[i]; - VG_(printf)(i < n-1 ? "%u:%llu " : "%u:%llu", st->thrid, (ULong)st->tym); + VG_(printf)(i < n-1 ? "%d:%llu " : "%d:%llu", st->thrid, (ULong)st->tym); } VG_(printf)("]"); } @@ -5050,7 +5050,7 @@ static void record_race_info ( Thr* acc_thr, (XACmpFn_t)cmp__ULong_n_EC__by_ULong ); if (0) VG_(printf)("record_race_info %u %u %u confThr %p " - "confTym %llu found %d (%lu,%lu)\n", + "confTym %llu found %d (%ld,%ld)\n", Cfailed, Kfailed, Cw, confThr, confTym, found, firstIx, lastIx); /* We can't indefinitely collect stack traces at VTS @@ -5779,7 +5779,7 @@ static void zsm_sset_range ( Addr a, SizeT len, SVal svNew ) stats__cache_make_New_arange += (ULong)len; if (0 && len > 500) - VG_(printf)("make New ( %#lx, %ld )\n", a, len ); + VG_(printf)("make New ( %#lx, %lu )\n", a, len ); if (0) { static UWord n_New_in_cache = 0; @@ -6445,8 +6445,8 @@ void libhb_shutdown ( Bool show_stats ) live++; hgthread = hgthread->admin; } - VG_(printf)(" libhb: threads live: %d exit_and_joinedwith %d" - " exit %d joinedwith %d\n", + VG_(printf)(" libhb: threads live: %u exit_and_joinedwith %u" + " exit %u joinedwith %u\n", live, llexit_and_joinedwith_done, llexit_done, joinedwith_done); VG_(printf)(" libhb: %d verydead_threads, " @@ -6505,7 +6505,7 @@ void libhb_shutdown ( Bool show_stats ) / (Double)(non0chain ? non0chain : 1)); for (i = 0; i <= MAXCHAIN; i++) { if (chains[i] != 0) - VG_(printf)( "[%d%s]=%d ", + VG_(printf)( "[%u%s]=%u ", i, i == MAXCHAIN ? "+" : "", chains[i]); } @@ -6860,9 +6860,9 @@ static void zsm_sset_range_noaccess (Addr addr, SizeT len) PlenCONSUME(APC, ARE, 1, APClen); if (0) - VG_(printf) ("addr %p[%ld] ARE %p" - " BPC %p[%ld] BFC %p[%ld] FSM %p[%ld]" - " AFC %p[%ld] APC %p[%ld]\n", + VG_(printf) ("addr %p[%lu] ARE %p" + " BPC %p[%lu] BFC %p[%lu] FSM %p[%lu]" + " AFC %p[%lu] APC %p[%lu]\n", (void*)addr, len, (void*)ARE, (void*)BPC, BPClen, (void*)BFC, BFClen, (void*)FSM, FSMlen, (void*)AFC, AFClen, (void*)APC, APClen);