public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch]: Fix build of binutils for all targets having uint32_t defined as unsigned long type
@ 2010-12-14 15:16 Kai Tietz
  2010-12-15  8:48 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Tietz @ 2010-12-14 15:16 UTC (permalink / raw)
  To: Binutils; +Cc: Nick Clifton

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

Hi,

this patch fixes an escaped patch to binutils/dwarf.c displaying some
information without taking care that print could raise warnings by
trying to use 'unsigned long' with signed/unsigned integer formatters.

ChangeLog

2010-12-14  Kai Tietz

        * dwarf.c (display_gdb_index): Fix printf types for
        used formatters.

Tested for cygwin (such a target). Ok for apply?

Kai
-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

[-- Attachment #2: b_fix.txt --]
[-- Type: text/plain, Size: 1343 bytes --]

Index: dwarf.c
===================================================================
RCS file: /cvs/src/src/binutils/dwarf.c,v
retrieving revision 1.81
diff -u -3 -r1.81 dwarf.c
--- dwarf.c	3 Dec 2010 17:07:19 -0000	1.81
+++ dwarf.c	14 Dec 2010 14:49:10 -0000
@@ -4889,13 +4889,13 @@
     }
 
   version = byte_get_little_endian (start, 4);
-  printf (_("Version %d\n"), version);
+  printf (_("Version %d\n"), (int) version);
 
   /* Prior versions are obsolete, and future versions may not be
      backwards compatible.  */
   if (version != 3)
     {
-      warn (_("Unsupported version %u.\n"), version);
+      warn (_("Unsupported version %u.\n"), (unsigned int) version);
       return 0;
     }
 
@@ -4960,7 +4960,7 @@
 
       print_dwarf_vma (low, 8);
       print_dwarf_vma (high, 8);
-      printf (_("%u\n"), cu_index);
+      printf (_("%u\n"), (unsigned int) cu_index);
     }
 
   printf (_("\nSymbol table:\n"));
@@ -4982,9 +4982,9 @@
 	      cu = byte_get_little_endian (constant_pool + cu_vector_offset + 4 + j * 4, 4);
 	      /* Convert to TU number if it's for a type unit.  */
 	      if (cu >= cu_list_elements)
-		printf (" T%u", cu - cu_list_elements);
+		printf (" T%u", (unsigned int) (cu - cu_list_elements));
 	      else
-		printf (" %u", cu);
+		printf (" %u", (unsigned int) cu);
 	    }
 	  printf ("\n");
 	}

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

* Re: [patch]: Fix build of binutils for all targets having uint32_t defined as unsigned long type
  2010-12-14 15:16 [patch]: Fix build of binutils for all targets having uint32_t defined as unsigned long type Kai Tietz
@ 2010-12-15  8:48 ` Alan Modra
  2010-12-15 10:55   ` Kai Tietz
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2010-12-15  8:48 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Binutils, Nick Clifton

On Tue, Dec 14, 2010 at 03:51:44PM +0100, Kai Tietz wrote:
>         * dwarf.c (display_gdb_index): Fix printf types for
>         used formatters.

I'd rather see cast to long/unsigned long and %ld/%lu in format
specifiers.  Patch to do so preapproved.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: [patch]: Fix build of binutils for all targets having uint32_t defined as unsigned long type
  2010-12-15  8:48 ` Alan Modra
@ 2010-12-15 10:55   ` Kai Tietz
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Tietz @ 2010-12-15 10:55 UTC (permalink / raw)
  To: Kai Tietz, Binutils, Nick Clifton

2010/12/15 Alan Modra <amodra@gmail.com>:
> On Tue, Dec 14, 2010 at 03:51:44PM +0100, Kai Tietz wrote:
>>         * dwarf.c (display_gdb_index): Fix printf types for
>>         used formatters.
>
> I'd rather see cast to long/unsigned long and %ld/%lu in format
> specifiers.  Patch to do so preapproved.

Ok, done and applied.

Thanks,
Kai

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

end of thread, other threads:[~2010-12-15  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 15:16 [patch]: Fix build of binutils for all targets having uint32_t defined as unsigned long type Kai Tietz
2010-12-15  8:48 ` Alan Modra
2010-12-15 10:55   ` Kai Tietz

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).