summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-02-02 19:29:39 -0200
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-02-02 19:29:39 -0200
commit23abe4d2846dc91e84cc4eb8756b4a53fb09825f (patch)
tree897c8af21da0cfb3609d745f5b5cb9b1ef82afa5
parent05c33f53081cf737852f86bf3e19891e99043103 (diff)
downloadgperftools-23abe4d2846dc91e84cc4eb8756b4a53fb09825f.tar.gz
Fix compiler warnings
-rw-r--r--src/heap-profiler.cc2
-rw-r--r--src/profiler.cc2
-rw-r--r--src/tests/heap-checker_unittest.cc4
-rw-r--r--src/tests/page_heap_test.cc1
4 files changed, 5 insertions, 4 deletions
diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc
index 532d0f2..f1f2c21 100644
--- a/src/heap-profiler.cc
+++ b/src/heap-profiler.cc
@@ -293,7 +293,7 @@ static void MaybeDumpProfileLocked() {
} else if (FLAGS_heap_profile_time_interval > 0 &&
current_time - last_dump_time >=
FLAGS_heap_profile_time_interval) {
- snprintf(buf, sizeof(buf), "%d sec since the last dump",
+ snprintf(buf, sizeof(buf), "%" PRId64 " sec since the last dump",
current_time - last_dump_time);
need_to_dump = true;
last_dump_time = current_time;
diff --git a/src/profiler.cc b/src/profiler.cc
index a850bb7..3d6abe3 100644
--- a/src/profiler.cc
+++ b/src/profiler.cc
@@ -205,7 +205,7 @@ CpuProfiler::CpuProfiler()
if (signal_number_str != NULL)
{
long int signal_number = strtol(signal_number_str, NULL, 10);
- printf("<debug> signal_number=%d\n", signal_number);
+ printf("<debug> signal_number=%" PRId64 "\n", signal_number);
if (signal_number >=1 && signal_number <=64)
{
sighandler_t old_signal_handler = signal(signal_number, CpuProfilerSwitch);
diff --git a/src/tests/heap-checker_unittest.cc b/src/tests/heap-checker_unittest.cc
index ab326c9..ba25079 100644
--- a/src/tests/heap-checker_unittest.cc
+++ b/src/tests/heap-checker_unittest.cc
@@ -340,6 +340,7 @@ static void DoRunHidden(Closure* c, int n) {
const int sz = 30;
volatile int arr[sz];
for (int i = 0; i < sz; ++i) arr[i] = 0;
+ (void)arr;
(*wipe_stack_ptr)(n-1);
sleep(0); // undo -foptimize-sibling-calls
}
@@ -570,7 +571,8 @@ static void TestHiddenPointer() {
// the xor trick itself works, as without it nothing in this
// test suite would work. See the Hide/Unhide/*Hidden* set
// of helper methods.
- CHECK_NE(foo, *reinterpret_cast<void**>(&p));
+ void** rp = reinterpret_cast<void**>(&p);
+ CHECK_NE(foo, *rp);
}
// simple tests that deallocate what they allocated
diff --git a/src/tests/page_heap_test.cc b/src/tests/page_heap_test.cc
index f08387c..5bd803d 100644
--- a/src/tests/page_heap_test.cc
+++ b/src/tests/page_heap_test.cc
@@ -43,7 +43,6 @@ static void TestPageHeap_Stats() {
// Split span 's1' into 's1', 's2'. Delete 's2'
tcmalloc::Span* s2 = ph->Split(s1, 128);
- Length s2_len = s2->length;
ph->Delete(s2);
CheckStats(ph, 256, 128, 0);