This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix printing the size of GOLD's memory areana on Cygwin based systems.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=04879304dea94c02f19fa5c219d2cbee6269f9af

commit 04879304dea94c02f19fa5c219d2cbee6269f9af
Author: Franz Sirl <franz.sirl-kernel@lauterbach.com>
Date:   Wed Jan 24 13:39:11 2018 +0000

    Fix printing the size of GOLD's memory areana on Cygwin based systems.
    
    I just stumbled over this with 2.29.1 while building a cross-toolchain, on Cygwin64, but it's still the same for 2.30. m.arena has size_t on Cygwin64 and thus errors out due to -Werror=format.
    
    gold	* main.cc: Print m.arena as long long.

Diff:
---
 gold/ChangeLog | 4 ++++
 gold/main.cc   | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index eeb19e7..486b65d 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,7 @@
+2018-07-11  Franz Sirl  <franz.sirl-kernel@lauterbach.com>
+
+	* main.cc (main): Print m.arena as long long.
+
 2018-07-09  Cary Coutant  <ccoutant@gmail.com>
 
 	* incremental.cc (Sized_incremental_binary::setup_readers): Use
diff --git a/gold/main.cc b/gold/main.cc
index aa6c698..06d810f 100644
--- a/gold/main.cc
+++ b/gold/main.cc
@@ -292,8 +292,8 @@ main(int argc, char** argv)
 
 #ifdef HAVE_MALLINFO
       struct mallinfo m = mallinfo();
-      fprintf(stderr, _("%s: total space allocated by malloc: %d bytes\n"),
-	      program_name, m.arena);
+      fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"),
+	      program_name, static_cast<long long>(m.arena));
 #endif
       File_read::print_stats();
       Archive::print_stats();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]