Author: njn Date: 2007-09-23 01:51:24 +0100 (Sun, 23 Sep 2007) New Revision: 6902
Log: Fix various format string errors, courtesy of Florian Krohm. Modified: trunk/cachegrind/cg_sim.c trunk/callgrind/bbcc.c trunk/callgrind/debug.c trunk/callgrind/dump.c trunk/callgrind/main.c trunk/callgrind/sim.c trunk/coregrind/m_libcassert.c trunk/coregrind/m_libcprint.c trunk/coregrind/m_main.c trunk/coregrind/m_mallocfree.c trunk/coregrind/m_scheduler/scheduler.c trunk/coregrind/m_signals.c trunk/coregrind/m_translate.c trunk/coregrind/m_ume.c trunk/helgrind/hg_main.c trunk/lackey/lk_main.c trunk/massif/ms_main.c trunk/memcheck/mc_leakcheck.c trunk/memcheck/mc_main.c Modified: trunk/cachegrind/cg_sim.c =================================================================== --- trunk/cachegrind/cg_sim.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/cachegrind/cg_sim.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -184,7 +184,7 @@ if (is_miss) { MISS_TREATMENT; } \ \ } else { \ - VG_(printf)("addr: %x size: %u sets: %d %d", a, size, set1, set2); \ + VG_(printf)("addr: %lx size: %u sets: %d %d", a, size, set1, set2);\ VG_(tool_panic)("item straddles more than two cache sets"); \ } \ return; \ Modified: trunk/callgrind/bbcc.c =================================================================== --- trunk/callgrind/bbcc.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/callgrind/bbcc.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -714,7 +714,7 @@ else ppIRJumpKind( jmpkind ); - VG_(printf)(" %08x -> %08x, SP %08x\n", + VG_(printf)(" %08lx -> %08x, SP %08x\n", last_bb ? bb_jmpaddr(last_bb) : 0, bb_addr(bb), sp); } Modified: trunk/callgrind/debug.c =================================================================== --- trunk/callgrind/debug.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/callgrind/debug.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -295,7 +295,7 @@ return; } - VG_(printf)("%08x/%c %d:", bb_addr(bbcc->bb), + VG_(printf)("%08lx/%c %d:", bb_addr(bbcc->bb), (bbcc->bb->sect_kind == Vg_SectText) ? 'T' : (bbcc->bb->sect_kind == Vg_SectData) ? 'D' : (bbcc->bb->sect_kind == Vg_SectBSS) ? 'B' : @@ -339,9 +339,9 @@ ecounter = bbcc->ecounter_sum; print_indent(s+2); - VG_(printf)("ECounter: sum %d ", ecounter); + VG_(printf)("ECounter: sum %llu ", ecounter); for(i=0; i<bb->cjmp_count; i++) { - VG_(printf)("[%d]=%d ", + VG_(printf)("[%d]=%llu ", bb->jmp[i].instr, bbcc->jmp[i].ecounter); } VG_(printf)("\n"); @@ -350,7 +350,7 @@ for(i=0; i<bb->instr_count; i++) { InstrInfo* ii = &(bb->instr[i]); print_indent(s+2); - VG_(printf)("[%2d] IOff %2d ecnt %3d ", + VG_(printf)("[%2d] IOff %2d ecnt %3llu ", i, ii->instr_offset, ecounter); CLG_(print_cost)(s+5, ii->eventset, bbcc->cost + ii->cost_offset); @@ -374,7 +374,7 @@ int ln, i=0, opos=0; if (addr == 0) { - VG_(printf)("%08x", addr); + VG_(printf)("%08lx", addr); return; } @@ -431,7 +431,7 @@ void* CLG_(malloc)(UWord s, char* f) { - CLG_DEBUG(3, "Malloc(%d) in %s.\n", s, f); + CLG_DEBUG(3, "Malloc(%lu) in %s.\n", s, f); return VG_(malloc)(s); } Modified: trunk/callgrind/dump.c =================================================================== --- trunk/callgrind/dump.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/callgrind/dump.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -554,7 +554,7 @@ void fprint_pos(Int fd, AddrPos* curr, AddrPos* last) { if (0) //CLG_(clo).dump_bbs) - VG_(sprintf)(outbuf, "%u ", curr->addr - curr->bb_addr); + VG_(sprintf)(outbuf, "%lu ", curr->addr - curr->bb_addr); else { int p = 0; if (CLG_(clo).dump_instr) { Modified: trunk/callgrind/main.c =================================================================== --- trunk/callgrind/main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/callgrind/main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -817,7 +817,7 @@ case VG_USERREQ__DUMP_STATS_AT: { Char buf[512]; - VG_(sprintf)(buf,"Client Request: %s", args[1]); + VG_(sprintf)(buf,"Client Request: %s", (Char*)args[1]); CLG_(dump_profile)(buf, True); *ret = 0; /* meaningless */ } Modified: trunk/callgrind/sim.c =================================================================== --- trunk/callgrind/sim.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/callgrind/sim.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -309,7 +309,7 @@ return ((res1 == Miss) || (res2 == Miss)) ? Miss : Hit; } else { - VG_(printf)("addr: %x size: %u sets: %d %d", a, size, set1, set2); + VG_(printf)("addr: %lx size: %u sets: %d %d", a, size, set1, set2); VG_(tool_panic)("item straddles more than two cache sets"); } return Hit; @@ -416,7 +416,7 @@ return ((res1 == Miss) || (res2 == Miss)) ? Miss : Hit; } else { - VG_(printf)("addr: %x size: %u sets: %d %d", a, size, set1, set2); + VG_(printf)("addr: %lx size: %u sets: %d %d", a, size, set1, set2); VG_(tool_panic)("item straddles more than two cache sets"); } return Hit; Modified: trunk/coregrind/m_libcassert.c =================================================================== --- trunk/coregrind/m_libcassert.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_libcassert.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -189,7 +189,7 @@ // Treat vg_assert2(0, "foo") specially, as a panicky abort if (VG_STREQ(expr, "0")) { VG_(printf)("\n%s: %s:%d (%s): the 'impossible' happened.\n", - component, file, line, fn, expr ); + component, file, line, fn ); } else { VG_(printf)("\n%s: %s:%d (%s): Assertion '%s' failed.\n", component, file, line, fn, expr ); Modified: trunk/coregrind/m_libcprint.c =================================================================== --- trunk/coregrind/m_libcprint.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_libcprint.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -216,7 +216,7 @@ if (m == 0) { // Have to generate the format string in order to be flexible about // the width of the field. - VG_(sprintf)(fmt, "%%-%lds", n_buf); + VG_(sprintf)(fmt, "%%-%ds", n_buf); // fmt is now "%<n_buf>s" where <d> is 1,2,3... VG_(sprintf)(buf, fmt, "--%"); return; Modified: trunk/coregrind/m_main.c =================================================================== --- trunk/coregrind/m_main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -958,7 +958,7 @@ } if (show) - VG_(printf)("fd limits: host, before: cur %u max %u\n", + VG_(printf)("fd limits: host, before: cur %lu max %lu\n", rl.rlim_cur, rl.rlim_max); # if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5) @@ -986,7 +986,7 @@ VG_(setrlimit)(VKI_RLIMIT_NOFILE, &rl); if (show) { - VG_(printf)("fd limits: host, after: cur %u max %u\n", + VG_(printf)("fd limits: host, after: cur %lu max %lu\n", rl.rlim_cur, rl.rlim_max); VG_(printf)("fd limits: guest : cur %u max %u\n", VG_(fd_soft_limit), VG_(fd_hard_limit)); Modified: trunk/coregrind/m_mallocfree.c =================================================================== --- trunk/coregrind/m_mallocfree.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_mallocfree.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -846,12 +846,12 @@ Superblock * sb = a->sblocks[j]; VG_(printf)( "\n" ); - VG_(printf)( "superblock %d at %p, sb->n_pl_bs = %d\n", + VG_(printf)( "superblock %d at %p, sb->n_pl_bs = %lu\n", blockno++, sb, 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 %d: ", i, b_bszB ); + VG_(printf)( " block at %d, bszB %lu: ", i, b_bszB ); VG_(printf)( "%s, ", is_inuse_block(b) ? "inuse" : "free"); VG_(printf)( "%s\n", blockSane(a, b) ? "ok" : "BAD" ); } @@ -901,15 +901,14 @@ 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 (bszB %d): " - " BAD\n", sb, i, b_bszB ); + VG_(printf)("sanity_check_malloc_arena: sb %p, block %d " + "(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 (bszB %d): " - "UNMERGED FREES\n", - sb, i, b_bszB ); + VG_(printf)("sanity_check_malloc_arena: sb %p, block %d " + "(bszB %lu): UNMERGED FREES\n", sb, i, b_bszB ); BOMB; } if (thisFree) blockctr_sb_free++; @@ -956,7 +955,7 @@ if (b_pszB < list_min_pszB || b_pszB > list_max_pszB) { VG_(printf)( "sanity_check_malloc_arena: list %d at %p: " - "WRONG CHAIN SIZE %dB (%dB, %dB)\n", + "WRONG CHAIN SIZE %luB (%luB, %luB)\n", listno, b, b_pszB, list_min_pszB, list_max_pszB ); BOMB; } @@ -1359,7 +1358,7 @@ if (req_alignB < VG_MIN_MALLOC_SZB || req_alignB > 1048576 || VG_(log2)( req_alignB ) == -1 /* not a power of 2 */) { - VG_(printf)("VG_(arena_memalign)(%p, %d, %d)\nbad alignment", + VG_(printf)("VG_(arena_memalign)(%p, %lu, %lu)\nbad alignment", a, req_alignB, req_pszB ); VG_(core_panic)("VG_(arena_memalign)"); /*NOTREACHED*/ Modified: trunk/coregrind/m_scheduler/scheduler.c =================================================================== --- trunk/coregrind/m_scheduler/scheduler.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_scheduler/scheduler.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -1337,7 +1337,7 @@ case VG_USERREQ__DISCARD_TRANSLATIONS: if (VG_(clo_verbosity) > 2) VG_(printf)( "client request: DISCARD_TRANSLATIONS," - " addr %p, len %d\n", + " addr %p, len %lu\n", (void*)arg[1], arg[2] ); VG_(discard_translations)( @@ -1358,7 +1358,7 @@ UWord ret; if (VG_(clo_verbosity) > 2) - VG_(printf)("client request: code %x, addr %p, len %d\n", + VG_(printf)("client request: code %lx, addr %p, len %lu\n", arg[0], (void*)arg[1], arg[2] ); if ( VG_TDICT_CALL(tool_handle_client_request, tid, arg, &ret) ) Modified: trunk/coregrind/m_signals.c =================================================================== --- trunk/coregrind/m_signals.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_signals.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -2077,7 +2077,7 @@ VG_(max_signal) = i; if (VG_(clo_trace_signals) && VG_(clo_verbosity) > 2) - VG_(printf)("snaffling handler 0x%x for signal %d\n", + VG_(printf)("snaffling handler 0x%lx for signal %d\n", (Addr)(sa.ksa_handler), i ); scss.scss_per_sig[i].scss_handler = sa.ksa_handler; Modified: trunk/coregrind/m_translate.c =================================================================== --- trunk/coregrind/m_translate.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_translate.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -590,7 +590,7 @@ /*NOTREACHED*/ dontchase: - if (0) VG_(printf)("not chasing into 0x%x\n", addr); + if (0) VG_(printf)("not chasing into 0x%lx\n", addr); return False; } Modified: trunk/coregrind/m_ume.c =================================================================== --- trunk/coregrind/m_ume.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/coregrind/m_ume.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -74,7 +74,7 @@ { if (res.isError) { VG_(printf)("valgrind: mmap(0x%llx, %lld) failed in UME " - "with error %d (%s).\n", + "with error %lu (%s).\n", (ULong)base, (Long)len, res.err, VG_(strerror)(res.err) ); if (res.err == VKI_EINVAL) { Modified: trunk/helgrind/hg_main.c =================================================================== --- trunk/helgrind/hg_main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/helgrind/hg_main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -553,7 +553,7 @@ sm->swords[(a & 0xFFFC) >> 2] = sword; if (VGE_IS_DISTINGUISHED_SM(sm)) { - VG_(printf)("wrote to distinguished 2ndary map! 0x%x\n", a); + VG_(printf)("wrote to distinguished 2ndary map! 0x%lx\n", a); // XXX: may be legit, but I want to know when it happens --njn VG_(tool_panic)("wrote to distinguished 2ndary map!"); } @@ -568,7 +568,7 @@ UInt sm_off = (a & 0xFFFC) >> 2; if (VGE_IS_DISTINGUISHED_SM(sm)) { - VG_(printf)("accessed distinguished 2ndary map! 0x%x\n", a); + VG_(printf)("accessed distinguished 2ndary map! 0x%lx\n", a); // XXX: may be legit, but I want to know when it happens --njn //VG_(tool_panic)("accessed distinguished 2ndary map!"); return SEC_MAP_ACCESS; @@ -3000,7 +3000,7 @@ sword = get_sword_addr(a); if (sword == SEC_MAP_ACCESS) { - VG_(printf)("read distinguished 2ndary map! 0x%x\n", a); + VG_(printf)("read distinguished 2ndary map! 0x%lx\n", a); return; } @@ -3110,7 +3110,7 @@ sword = get_sword_addr(a); if (sword == SEC_MAP_ACCESS) { - VG_(printf)("read distinguished 2ndary map! 0x%x\n", a); + VG_(printf)("read distinguished 2ndary map! 0x%lx\n", a); return; } Modified: trunk/lackey/lk_main.c =================================================================== --- trunk/lackey/lk_main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/lackey/lk_main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -444,22 +444,22 @@ static VG_REGPARM(2) void trace_instr(Addr addr, SizeT size) { - VG_(printf)("I %08lx,%d\n", addr, size); + VG_(printf)("I %08lx,%lu\n", addr, size); } static VG_REGPARM(2) void trace_load(Addr addr, SizeT size) { - VG_(printf)(" L %08lx,%d\n", addr, size); + VG_(printf)(" L %08lx,%lu\n", addr, size); } static VG_REGPARM(2) void trace_store(Addr addr, SizeT size) { - VG_(printf)(" S %08lx,%d\n", addr, size); + VG_(printf)(" S %08lx,%lu\n", addr, size); } static VG_REGPARM(2) void trace_modify(Addr addr, SizeT size) { - VG_(printf)(" M %08lx,%d\n", addr, size); + VG_(printf)(" M %08lx,%lu\n", addr, size); } Modified: trunk/massif/ms_main.c =================================================================== --- trunk/massif/ms_main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/massif/ms_main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -1325,7 +1325,7 @@ if ( ! VG_(get_fnname)(xtree_snapshot->xpt->ip, buf2, 16)) { VG_(sprintf)(buf2, "???"); } - SPRINTF(buf, "x%x:%s %d\n", xtree_snapshot->xpt->ip, + SPRINTF(buf, "x%lx:%s %d\n", xtree_snapshot->xpt->ip, clean_fnname(buf3, buf2), xtree_snapshot->space); } Modified: trunk/memcheck/mc_leakcheck.c =================================================================== --- trunk/memcheck/mc_leakcheck.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/memcheck/mc_leakcheck.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -273,11 +273,11 @@ if (sh_no != clique) { if (VG_DEBUG_CLIQUE) { if (lc_markstack[sh_no].indirect) - VG_(printf)(" clique %d joining clique %d adding %d+%d bytes\n", + VG_(printf)(" clique %d joining clique %d adding %lu+%lu bytes\n", sh_no, clique, lc_shadows[sh_no]->szB, lc_markstack[sh_no].indirect); else - VG_(printf)(" %d joining %d adding %d\n", + VG_(printf)(" %d joining %d adding %lu\n", sh_no, clique, lc_shadows[sh_no]->szB); } Modified: trunk/memcheck/mc_main.c =================================================================== --- trunk/memcheck/mc_main.c 2007-09-22 07:15:46 UTC (rev 6901) +++ trunk/memcheck/mc_main.c 2007-09-23 00:51:24 UTC (rev 6902) @@ -2196,7 +2196,7 @@ { tl_assert(sizeof(UWord) == sizeof(SizeT)); if (0) - VG_(printf)("helperc_MAKE_STACK_UNINIT %p %d\n", base, len ); + VG_(printf)("helperc_MAKE_STACK_UNINIT %p %lu\n", base, len ); # if 0 /* Really slow version */ ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers