Article View: gnu.utils.bug
Article #1208Re: patch for binutils/size.c to print unsigned long rather than ints
From: Kevin Dalley
Date: Wed, 16 Dec 1992 04:24
Date: Wed, 16 Dec 1992 04:24
55 lines
2196 bytes
2196 bytes
>>>>> On 14 Dec 92 14:58:24 GMT, bothner@cygnus.com said:
> One could argue that bfd_size_type is more appropriate in some
> situations.
bothner> I think so, so that is what I did.
bothner> Please try the appended patch instead.
Almost. Here's another set of patches that needs to be applied on top
of it. When the radix is decimal, the objects that are bfd_size_type
should be printed as unsigned (%u), otherwise negative sizes show up.
I added one change that I missed in my earlier patch.
Note: This patch should be applied after Per Bothner's patch.
RCS file: /usr/local/src/CVS/binutils/binutils/size.c,v
retrieving revision 1.4
co warning: redefinition of -V option
diff -u -r1.4 size.c
--- 1.4 92/12/15 11:24:38
+++ size.c 92/12/15 20:19:33
@@ -232,7 +232,7 @@
int width;
bfd_size_type num;
{
- printf ((radix == decimal ? "%-*ld\t" :
+ printf ((radix == decimal ? "%-*lu\t" :
((radix == octal) ? "%-*lo\t" : "%-*lx\t")), width, (long)num);
}
@@ -241,7 +241,7 @@
int width;
bfd_size_type num;
{
- printf ((radix == decimal ? "%*ld\t" :
+ printf ((radix == decimal ? "%*lu\t" :
((radix == octal) ? "%*lo\t" : "%*lx\t")), width, (long)num);
}
@@ -299,7 +299,7 @@
lprint_number (7, textsize);
lprint_number (7, datasize);
lprint_number (7, bsssize);
- printf (((radix == octal) ? "%-7lo\t%-7lx\t" : "%-7ld\t%-7lx\t"),
+ printf (((radix == octal) ? "%-7lo\t%-7lx\t" : "%-7lu\t%-7lx\t"),
(long)total, (long)total);
fputs(bfd_get_filename(abfd), stdout);
--
Kevin Dalley
Toshiba America MRI, Inc.
kevin@tamri.com
Technical Details
Message-ID:
<KEVIN.92Dec15202457@polkacide.tamri.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tamri.COM!kevinReferences:
kevin@tamri.COM (Kevin Dalley)Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tamri.COM!kevin From: kevin@tamri.COM (Kevin Dalley) Subject: Re: patch for binutils/size.c to print unsigned long rather than ints Message-ID: <KEVIN.92Dec15202457@polkacide.tamri.com> Sender: gnulists@ai.mit.edu Reply-To: kevin@tamri.com Organization: TOSHIBA America MRI, South San Francisco, CA References: kevin@tamri.COM (Kevin Dalley) Distribution: gnu Date: Wed, 16 Dec 1992 04:24:59 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 58