public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch][gold] Fix build on 64 bits
@ 2010-09-08 19:53 Rafael Espindola
  2010-09-08 19:55 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael Espindola @ 2010-09-08 19:53 UTC (permalink / raw)
  To: Binutils; +Cc: Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

This fixes warning when building on a 64 bits host.

2010-09-08  Rafael Espindola  <espindola@google.com>

	* script-sections.cc (Script_sections::add_memory_region): Convert
	field precision to int.
	* script.cc (script_set_section_region, script_set_section_region):
	Convert field precision to int.

Cheers,
-- 
Rafael Ávila de Espíndola

[-- Attachment #2: len.patch --]
[-- Type: text/x-patch, Size: 1475 bytes --]

diff --git a/gold/script-sections.cc b/gold/script-sections.cc
index 8183bf2..1e576c4 100644
--- a/gold/script-sections.cc
+++ b/gold/script-sections.cc
@@ -2788,7 +2788,7 @@ Script_sections::add_memory_region(const char* name, size_t namelen,
     this->memory_regions_ = new Memory_regions();
   else if (this->find_memory_region(name, namelen))
     {
-      gold_error (_("region '%.*s' already defined"), namelen, name);
+      gold_error (_("region '%.*s' already defined"), int(namelen), name);
       // FIXME: Add a GOLD extension to allow multiple regions with the same
       // name.  This would amount to a single region covering disjoint blocks
       // of memory, which is useful for embedded devices.
diff --git a/gold/script.cc b/gold/script.cc
index 300b19b..8c4e163 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -3231,7 +3231,7 @@ script_set_section_region(void* closurev, const char* name, size_t namelen,
       gold_error(_("%s:%d:%d: MEMORY region '%.*s' referred to outside of "
 		   "SECTIONS clause"),
 		 closure->filename(), closure->lineno(), closure->charpos(),
-		 namelen, name);
+		 int(namelen), name);
       return;
     }
 
@@ -3241,7 +3241,7 @@ script_set_section_region(void* closurev, const char* name, size_t namelen,
     {
       gold_error(_("%s:%d:%d: MEMORY region '%.*s' not declared"),
 		 closure->filename(), closure->lineno(), closure->charpos(),
-		 namelen, name);
+		 int(namelen), name);
       return;
     }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch][gold] Fix build on 64 bits
  2010-09-08 19:53 [patch][gold] Fix build on 64 bits Rafael Espindola
@ 2010-09-08 19:55 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-09-08 19:55 UTC (permalink / raw)
  To: Rafael Espindola; +Cc: Binutils

Rafael Espindola <espindola@google.com> writes:

> This fixes warning when building on a 64 bits host.
>
> 2010-09-08  Rafael Espindola  <espindola@google.com>
>
> 	* script-sections.cc (Script_sections::add_memory_region): Convert
> 	field precision to int.
> 	* script.cc (script_set_section_region, script_set_section_region):
> 	Convert field precision to int.

> +      gold_error (_("region '%.*s' already defined"), int(namelen), name);

Write static_cast<int>(namelen) (and you will probably have to break the
line).

> +		 int(namelen), name);

static_cast here too.

> +		 int(namelen), name);

And here.

The patch is OK with those changes.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-08 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 19:53 [patch][gold] Fix build on 64 bits Rafael Espindola
2010-09-08 19:55 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).