From bb0bfe4f65b1808979cd1aacf6240c83575a4f92 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Mon, 22 Feb 2010 18:26:29 +0000 Subject: [PATCH] 2010-02-22 Doug Kwan * gold-threads.h (Once::~Once): Explicitly define virtual destructor. * icf.cc (get_section_contents): Cast snprintf arguments to long long types to avoid warnings due to different uint64_t implementations on different hosts. --- gold/ChangeLog | 7 +++++++ gold/gold-threads.h | 4 ++++ gold/icf.cc | 9 +++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index c9e60052530..056a506c704 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2010-02-22 Doug Kwan + + * gold-threads.h (Once::~Once): Explicitly define virtual destructor. + * icf.cc (get_section_contents): Cast snprintf arguments to long long + types to avoid warnings due to different uint64_t implementations + on different hosts. + 2010-02-21 Doug Kwan * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in diff --git a/gold/gold-threads.h b/gold/gold-threads.h index 78a87b24d64..622bf329d16 100644 --- a/gold/gold-threads.h +++ b/gold/gold-threads.h @@ -200,6 +200,10 @@ class Once public: Once(); + virtual + ~Once() + { } + // Call this function to do whatever it is. We pass an argument // even though you have to use a child class because in some uses // setting the argument would itself require a Once class. diff --git a/gold/icf.cc b/gold/icf.cc index 752aa5599c1..ff2058cfcba 100644 --- a/gold/icf.cc +++ b/gold/icf.cc @@ -278,8 +278,13 @@ get_section_contents(bool first_iteration, // where first is the symbol value and second is the // addend. char addend_str[50]; - snprintf(addend_str, sizeof(addend_str), "%llx %llx %lux", - (*it_a).first, (*it_a).second, (*it_o)); + + // It would be nice if we could use format macros in inttypes.h + // here but there are not in ISO/IEC C++ 1998. + snprintf(addend_str, sizeof(addend_str), "%llx %llx %llux", + static_cast((*it_a).first), + static_cast((*it_a).second), + static_cast(*it_o)); Section_id reloc_secn(it_v->first, it_v->second); // If this reloc turns back and points to the same section, -- 2.30.2