This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFA] fix debug compilation warnings
- From: Christian Groessler <chris at groessler dot org>
- To: binutils at sources dot redhat dot com
- Cc: chris at groessler dot org
- Date: 30 May 2005 22:43:59 +0200
- Subject: [RFA] fix debug compilation warnings
Hi,
compiling gas/write.c with debug parts enabled gives some warnings.
I've compiled with
#define DEBUG1
#define DEBUG2
#define DEBUG3
#define DEBUG4
#define DEBUG5
at the beginning of the file.
Ok to apply?
chris
gas/ChangeLog:
2005-05-30 Christian Groessler <chris@groessler.org>
* write.c (dump_section_relocs): Convert to ISO-C. Avoid
signed/unsigned warnings in debug code.
Index: write.c
===================================================================
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.90
diff -u -p -r1.90 write.c
--- write.c 9 May 2005 14:20:49 -0000 1.90
+++ write.c 30 May 2005 20:33:26 -0000
@@ -713,12 +713,8 @@ size_seg (bfd *abfd, asection *sec, PTR
#ifdef DEBUG2
static void
-dump_section_relocs (abfd, sec, stream_)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *sec;
- char *stream_;
+dump_section_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, FILE *stream)
{
- FILE *stream = (FILE *) stream_;
segment_info_type *seginfo = seg_info (sec);
fixS *fixp = seginfo->fix_root;
@@ -1060,7 +1056,7 @@ write_relocs (bfd *abfd, asection *sec,
#ifdef DEBUG4
{
- int i, j, nsyms;
+ unsigned int i, j, nsyms;
asymbol **sympp;
sympp = bfd_get_outsymbols (stdoutput);
nsyms = bfd_get_symcount (stdoutput);
@@ -1089,7 +1085,7 @@ write_relocs (bfd *abfd, asection *sec,
#ifdef DEBUG3
{
- int i;
+ unsigned int i;
arelent *r;
asymbol *s;
fprintf (stderr, "relocs for sec %s\n", sec->name);
@@ -1097,8 +1093,8 @@ write_relocs (bfd *abfd, asection *sec,
{
r = relocs[i];
s = *r->sym_ptr_ptr;
- fprintf (stderr, " reloc %2d @%08x off %4x : sym %-10s addend %x\n",
- i, r, r->address, s->name, r->addend);
+ fprintf (stderr, " reloc %2d @%p off %4lx : sym %-10s addend %lx\n",
+ i, r, (unsigned long)r->address, s->name, (unsigned long)r->addend);
}
}
#endif