|
From: <sv...@va...> - 2015-08-03 21:05:32
|
Author: florian
Date: Mon Aug 3 22:05:20 2015
New Revision: 15479
Log:
Fix printf format inconsistencies as pointed out by gcc -Wformat-signedness.
Modified:
trunk/exp-bbv/bbv_main.c
trunk/exp-dhat/dh_main.c
trunk/exp-sgcheck/pc_common.c
trunk/exp-sgcheck/sg_main.c
trunk/massif/ms_main.c
Modified: trunk/exp-bbv/bbv_main.c
==============================================================================
--- trunk/exp-bbv/bbv_main.c (original)
+++ trunk/exp-bbv/bbv_main.c Mon Aug 3 22:05:20 2015
@@ -116,8 +116,8 @@
/* and function name for each basic block */
VG_(OSetGen_ResetIter)(instr_info_table);
while ( (bb_elem = VG_(OSetGen_Next)(instr_info_table)) ) {
- VG_(fprintf)( fp, "F:%d:%x:%s\n", bb_elem->block_num,
- (Int)bb_elem->BB_addr, bb_elem->fn_name);
+ VG_(fprintf)( fp, "F:%d:%lx:%s\n", bb_elem->block_num,
+ bb_elem->BB_addr, bb_elem->fn_name);
}
VG_(fclose)(fp);
@@ -565,10 +565,10 @@
VG_(sprintf)(buf,"\n\n"
"# Thread %d\n"
"# Total intervals: %d (Interval Size %d)\n"
- "# Total instructions: %lld\n"
- "# Total reps: %lld\n"
- "# Unique reps: %lld\n"
- "# Total fldcw instructions: %lld\n\n",
+ "# Total instructions: %llu\n"
+ "# Total reps: %llu\n"
+ "# Unique reps: %llu\n"
+ "# Total fldcw instructions: %llu\n\n",
i,
(Int)(bbv_thread[i].total_instr/(ULong)interval_size),
interval_size,
Modified: trunk/exp-dhat/dh_main.c
==============================================================================
--- trunk/exp-dhat/dh_main.c (original)
+++ trunk/exp-dhat/dh_main.c Mon Aug 3 22:05:20 2015
@@ -494,7 +494,7 @@
intro_Block(bk);
- if (0) VG_(printf)("ALLOC %ld -> %p\n", req_szB, p);
+ if (0) VG_(printf)("ALLOC %lu -> %p\n", req_szB, p);
return p;
}
@@ -537,7 +537,7 @@
static
void* renew_block ( ThreadId tid, void* p_old, SizeT new_req_szB )
{
- if (0) VG_(printf)("REALL %p %ld\n", p_old, new_req_szB);
+ if (0) VG_(printf)("REALL %p %lu\n", p_old, new_req_szB);
void* p_new = NULL;
tl_assert(new_req_szB > 0); // map 0 to 1
Modified: trunk/exp-sgcheck/pc_common.c
==============================================================================
--- trunk/exp-sgcheck/pc_common.c (original)
+++ trunk/exp-sgcheck/pc_common.c Mon Aug 3 22:05:20 2015
@@ -564,8 +564,8 @@
what, s );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
- emit( " <auxwhat>Address %#lx is %ld bytes inside a "
- "%ld-byte block free'd</auxwhat>\n",
+ emit( " <auxwhat>Address %#lx is %lu bytes inside a "
+ "%lu-byte block free'd</auxwhat>\n",
lo, lo-Seg__addr(seglo), Seg__size(seglo) );
VG_(pp_ExeContext)(Seg__where(seglo));
@@ -575,8 +575,8 @@
what, s );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
- emit( " Address %#lx is %ld bytes inside a "
- "%ld-byte block free'd\n",
+ emit( " Address %#lx is %lu bytes inside a "
+ "%lu-byte block free'd\n",
lo, lo-Seg__addr(seglo), Seg__size(seglo) );
VG_(pp_ExeContext)(Seg__where(seglo));
@@ -595,8 +595,8 @@
emit( " <auxwhat>First byte is "
"not inside a known block</auxwhat>\n" );
} else {
- emit( " <auxwhat>First byte (%#lx) is %ld bytes inside a "
- "%ld-byte block alloc'd</auxwhat>\n",
+ emit( " <auxwhat>First byte (%#lx) is %lu bytes inside a "
+ "%lu-byte block alloc'd</auxwhat>\n",
lo, lo-Seg__addr(seglo), Seg__size(seglo) );
VG_(pp_ExeContext)(Seg__where(seglo));
}
@@ -605,8 +605,8 @@
emit( " <auxwhat>Last byte is "
"not inside a known block</auxwhat>\n" );
} else {
- emit( " <auxwhat>Last byte (%#lx) is %ld bytes inside a "
- "%ld-byte block alloc'd</auxwhat>\n",
+ emit( " <auxwhat>Last byte (%#lx) is %lu bytes inside a "
+ "%lu-byte block alloc'd</auxwhat>\n",
hi, hi-Seg__addr(seghi), Seg__size(seghi) );
VG_(pp_ExeContext)(Seg__where(seghi));
}
@@ -620,8 +620,8 @@
if (UNKNOWN == seglo) {
emit( " First byte is not inside a known block\n" );
} else {
- emit( " First byte (%#lx) is %ld bytes inside a "
- "%ld-byte block alloc'd\n",
+ emit( " First byte (%#lx) is %lu bytes inside a "
+ "%lu-byte block alloc'd\n",
lo, lo-Seg__addr(seglo), Seg__size(seglo) );
VG_(pp_ExeContext)(Seg__where(seglo));
}
@@ -629,8 +629,8 @@
if (UNKNOWN == seghi) {
emit( " Last byte is not inside a known block\n" );
} else {
- emit( " Last byte (%#lx) is %ld bytes inside a "
- "%ld-byte block alloc'd\n",
+ emit( " Last byte (%#lx) is %lu bytes inside a "
+ "%lu-byte block alloc'd\n",
hi, hi-Seg__addr(seghi), Seg__size(seghi) );
VG_(pp_ExeContext)(Seg__where(seghi));
}
Modified: trunk/exp-sgcheck/sg_main.c
==============================================================================
--- trunk/exp-sgcheck/sg_main.c (original)
+++ trunk/exp-sgcheck/sg_main.c Mon Aug 3 22:05:20 2015
@@ -631,7 +631,7 @@
static void GlobalTreeNode__pp ( GlobalTreeNode* nd ) {
tl_assert(nd->descr);
- VG_(printf)("GTNode [%#lx,+%ld) %s",
+ VG_(printf)("GTNode [%#lx,+%lu) %s",
nd->addr, nd->szB, nd->descr->name);
}
@@ -1648,7 +1648,7 @@
sKey.szB = szB;
gKey.addr = ea;
gKey.szB = szB;
- if (0) VG_(printf)("Tree sizes %ld %ld\n",
+ if (0) VG_(printf)("Tree sizes %lu %lu\n",
VG_(sizeFM)(siTrees[tid]), VG_(sizeFM)(giTree));
sOK = VG_(findBoundsFM)( siTrees[tid],
(UWord*)&sLB, NULL/*unused*/,
@@ -1896,7 +1896,7 @@
if (0 && (sb || gb))
VG_(message)(Vg_DebugMsg,
"exp-sgcheck: new max tree sizes: "
- "StackTree %ld, GlobalTree %ld\n",
+ "StackTree %lu, GlobalTree %lu\n",
stats__max_sitree_size, stats__max_gitree_size );
}
} else {
Modified: trunk/massif/ms_main.c
==============================================================================
--- trunk/massif/ms_main.c (original)
+++ trunk/massif/ms_main.c Mon Aug 3 22:05:20 2015
@@ -1115,7 +1115,7 @@
default:
tl_assert2(0, "VERB_snapshot: unknown snapshot kind: %d", snapshot->kind);
}
- VERB(verbosity, "%s S%s%3d (t:%lld, hp:%ld, ex:%ld, st:%ld)\n",
+ VERB(verbosity, "%s S%s%3d (t:%lld, hp:%lu, ex:%lu, st:%lu)\n",
prefix, suffix, i,
snapshot->time,
snapshot->heap_szB,
@@ -1722,7 +1722,8 @@
}
VERB(3, ">>> (%ld, %ld)\n",
- new_req_szB - old_req_szB, new_slop_szB - old_slop_szB);
+ (SSizeT)(new_req_szB - old_req_szB),
+ (SSizeT)(new_slop_szB - old_slop_szB));
}
return p_new;
@@ -1902,7 +1903,7 @@
static INLINE void new_mem_stack_2(SizeT len, const HChar* what)
{
if (have_started_executing_code) {
- VERB(3, "<<< new_mem_stack (%ld)\n", len);
+ VERB(3, "<<< new_mem_stack (%lu)\n", len);
n_stack_allocs++;
update_stack_stats(len);
maybe_take_snapshot(Normal, what);
@@ -1913,7 +1914,7 @@
static INLINE void die_mem_stack_2(SizeT len, const HChar* what)
{
if (have_started_executing_code) {
- VERB(3, "<<< die_mem_stack (%ld)\n", -len);
+ VERB(3, "<<< die_mem_stack (-%lu)\n", len);
n_stack_frees++;
maybe_take_snapshot(Peak, "stkPEAK");
update_stack_stats(-len);
@@ -2149,7 +2150,7 @@
}
// Do the non-ip_desc part first...
- FP("%sn%d: %lu ", depth_str, sxpt->Sig.n_children, sxpt->szB);
+ FP("%sn%u: %lu ", depth_str, sxpt->Sig.n_children, sxpt->szB);
// For ip_descs beginning with "0xABCD...:" addresses, we first
// measure the length of the "0xabcd: " address at the start of the
@@ -2407,7 +2408,7 @@
STATS("stack allocs: %u\n", n_stack_allocs);
STATS("stack frees: %u\n", n_stack_frees);
STATS("XPts: %u\n", n_xpts);
- STATS("top-XPts: %u (%d%%)\n",
+ STATS("top-XPts: %u (%u%%)\n",
alloc_xpt->n_children,
( n_xpts ? alloc_xpt->n_children * 100 / n_xpts : 0));
STATS("XPt init expansions: %u\n", n_xpt_init_expansions);
|