]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix various format string errors, courtesy of Florian Krohm.
authorNicholas Nethercote <njn@valgrind.org>
Sun, 23 Sep 2007 00:51:24 +0000 (00:51 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 23 Sep 2007 00:51:24 +0000 (00:51 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6902

19 files changed:
cachegrind/cg_sim.c
callgrind/bbcc.c
callgrind/debug.c
callgrind/dump.c
callgrind/main.c
callgrind/sim.c
coregrind/m_libcassert.c
coregrind/m_libcprint.c
coregrind/m_main.c
coregrind/m_mallocfree.c
coregrind/m_scheduler/scheduler.c
coregrind/m_signals.c
coregrind/m_translate.c
coregrind/m_ume.c
helgrind/hg_main.c
lackey/lk_main.c
massif/ms_main.c
memcheck/mc_leakcheck.c
memcheck/mc_main.c

index 80cdbfb6bfeaf4a8c17c3449ca8f3e2b194bdc57..12fb61bab1db42f222621bfc4ad230d1718fdc21 100644 (file)
@@ -184,7 +184,7 @@ miss_treatment:                                                             \
       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;                                                                  \
index 89ebdfda80dec9dce0e8e33720717ad3daa741b0..e31ccc798c1c73db897d73c84b9a4f02df92516a 100644 (file)
@@ -714,7 +714,7 @@ void CLG_(setup_bbcc)(BB* bb)
       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);
   }
index ff700ee87dd994a65dfe0f69dc146542ee8abeef..aaeedbe693f36a68023447c03346d3c85cc869a3 100644 (file)
@@ -295,7 +295,7 @@ void CLG_(print_bbcc_fn)(BBCC* bbcc)
        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 @@ void CLG_(print_bbcc_cost)(int s, BBCC* bbcc)
   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 @@ void CLG_(print_bbcc_cost)(int s, BBCC* bbcc)
   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 @@ void CLG_(print_addr)(Addr addr)
     int ln, i=0, opos=0;
        
     if (addr == 0) {
-       VG_(printf)("%08x", addr);
+       VG_(printf)("%08lx", addr);
        return;
     }
 
@@ -431,7 +431,7 @@ void CLG_(print_context)(void)
 
 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);
 }
 
index dd445e274244fac7e2280e2723399e552e024015..2a0442a0eae56d8ac00796dbc3d88d59dd432b73 100644 (file)
@@ -554,7 +554,7 @@ static
 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) {
index 52cc4b063806f1001facceaaefc68a0dc37efa15..7f2abdf4f3481e6fc87b1e3368235d750076182c 100644 (file)
@@ -817,7 +817,7 @@ Bool CLG_(handle_client_request)(ThreadId tid, UWord *args, UWord *ret)
    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 */
      }
index f15fc7d0c5f1e18728e14884f0d05a9f6d9d5ec9..e785e1154e6a27fc0eaf308a04a4570d2de66ef3 100644 (file)
@@ -309,7 +309,7 @@ static CacheResult cachesim_ref(cache_t2* c, Addr a, UChar size)
        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 @@ CacheResult cachesim_ref_wb(cache_t2* c, RefType ref, Addr a, UChar size)
        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;
index ddafdfbf90214a602f7e23c51af5382ea9fd9d03..a2b8a4c05b526539553b62be95017955973a40a5 100644 (file)
@@ -189,7 +189,7 @@ void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,
    // 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 );
index 252d007a006957445276d4435c55b73a491fc127..a5129ef66abf38042882c2cb6ad1ca8741787fba 100644 (file)
@@ -216,7 +216,7 @@ void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[])
    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;
index 6e69e88cf8f787dff09806f3d9762d603f7e1a1a..18aa7de56465fa73f7d749bf7fab4b95cbe08356 100644 (file)
@@ -958,7 +958,7 @@ static void setup_file_descriptors(void)
    }
 
    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 @@ static void setup_file_descriptors(void)
    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));
index 6f64d7ea96daa884551b2ad800710fa5a22811c8..131d179d0974ad9d4288630ca2f850d9306868c5 100644 (file)
@@ -846,12 +846,12 @@ void ppSuperblocks ( Arena* a )
       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 @@ 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 (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 @@ static void sanity_check_malloc_arena ( ArenaId aid )
          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 @@ void* VG_(arena_memalign) ( ArenaId aid, SizeT req_alignB, SizeT req_pszB )
    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*/
index cc69fd398c7729ea486b514ba82f844d72578e26..1978adc827d3df71e55a385abc136914337c309f 100644 (file)
@@ -1337,7 +1337,7 @@ void do_client_request ( ThreadId tid )
       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 @@ void do_client_request ( ThreadId tid )
            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) )
index 6af368f256c3183697eb781b5ae415c90c17792b..a98f243956b6ab75168b3ba0f455b5c1ee9f34ea 100644 (file)
@@ -2077,7 +2077,7 @@ void VG_(sigstartup_actions) ( void )
       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;
index eec5e8f7494d2e7d4a98a293f6233e59353282e3..f3fadea762b95d2046795f81bc7b872904efacf2 100644 (file)
@@ -590,7 +590,7 @@ static Bool chase_into_ok ( void* closureV, Addr64 addr64 )
    /*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;
 }
 
index 92d4012425b3cb0c7aa91fe9f2bdf1575f11378e..0b205265a90d13643bff80cbe0d5c9169c06e09b 100644 (file)
@@ -74,7 +74,7 @@ static void check_mmap(SysRes res, Addr base, SizeT len)
 {
    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) {
index 1e974533936e694d28f606a4f5c194e69876e8bb..1b5a2ab2206ab3363c49582a8740b90f2742ce48 100644 (file)
@@ -553,7 +553,7 @@ void set_sword ( Addr a, shadow_word sword )
    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 @@ shadow_word* get_sword_addr ( Addr a )
    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 @@ static void hg_mem_read_word(Addr a, ThreadId tid)
 
    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 @@ static void hg_mem_write_word(Addr a, ThreadId tid)
 
    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;
    }
 
index 028a1aaa2d6804ed88fccf43e706077ac20d6c2d..8f9cf95e997ea9551b0264f8b535a22caacf6f82 100644 (file)
@@ -444,22 +444,22 @@ static Int   events_used = 0;
 
 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);
 }
 
 
index 3941a2418f453241b16471ddf301dc147ef6a1c9..781368f8e3491682e45c741fd26b7101f5af45c0 100644 (file)
@@ -1325,7 +1325,7 @@ static void write_hp_file(void)
             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);
          }
 
index 79b767f45cdf829b4aa4852470781720a018203d..fc94fb7a09101303694797c40d125a46c37e5992 100644 (file)
@@ -273,11 +273,11 @@ static void lc_markstack_push_WRK(Addr ptr, Int clique)
         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);
            }
 
index 0c09b18c9406731b6436453c1778512c88f3ed19..06546d25b29ab4aeac9bc867fa86c814e5bf11b2 100644 (file)
@@ -2196,7 +2196,7 @@ void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len )
 {
    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 */