]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
authorIan Lance Taylor <ian@airs.com>
Sun, 11 Jul 1999 20:02:30 +0000 (20:02 +0000)
committerIan Lance Taylor <ian@airs.com>
Sun, 11 Jul 1999 20:02:30 +0000 (20:02 +0000)
as appropriate.  Add variable initializations.  Add casts.
* objdump.c (disassemble_bytes): Change j to bfd_vma.
* readelf.c (process_syminfo): Change i to unsigned int.
(display_debug_info): Change abbrev_number to unsigned long.
(process_mips_specific): Change fcnt to size_t.

16 files changed:
binutils/ChangeLog
binutils/addr2line.c
binutils/arparse.y
binutils/arsup.c
binutils/debug.c
binutils/filemode.c
binutils/ieee.c
binutils/nm.c
binutils/objcopy.c
binutils/objdump.c
binutils/prdbg.c
binutils/rdcoff.c
binutils/readelf.c
binutils/size.c
binutils/stabs.c
binutils/wrstabs.c

index f7f25a1d0159066c12ff04868619e35f53187d6b..f68bfd95193b7f26f48cea375ee5333b1d42eeda 100644 (file)
@@ -1,3 +1,12 @@
+1999-07-11  Ian Lance Taylor  <ian@zembu.com>
+
+       * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+       as appropriate.  Add variable initializations.  Add casts.
+       * objdump.c (disassemble_bytes): Change j to bfd_vma.
+       * readelf.c (process_syminfo): Change i to unsigned int.
+       (display_debug_info): Change abbrev_number to unsigned long.
+       (process_mips_specific): Change fcnt to size_t.
+
 1999-07-09  Nick Clifton  <nickc@cygnus.com>
 
        * readelf.c: Only support decoding 64bit ELF files if the compiler
index 3cee867f3e16ea1a5ed60459c27a9801ec6318cc..72707c20bbb6cc871e293e8ab63311112f81687e 100644 (file)
@@ -123,7 +123,7 @@ static void
 find_address_in_section (abfd, section, data)
      bfd *abfd;
      asection *section;
-     PTR data;
+     PTR data ATTRIBUTE_UNUSED;
 {
   bfd_vma vma;
   bfd_size_type size;
index d6c7600a87cc8d41c9b241c71af6bd459b3b3940..a5e90faeb1b3991b93522792b9981ef036853f7c 100644 (file)
@@ -193,7 +193,7 @@ verbose_command:
 
 static int
 yyerror (x)
-     const char *x;
+     const char *x ATTRIBUTE_UNUSED;
 {
   extern int linenumber;
 
index 38fd6953c899df7380f1ebfaa30a94aa735eec54..d6809fc47497a652fcfaf6fade10a4a9ef32613e 100644 (file)
@@ -1,5 +1,6 @@
 /* arsup.c - Archive support for MRI compatibility
-   Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
+   Free Software Foundation, Inc.
 
 This file is part of GNU Binutils.
 
@@ -95,7 +96,7 @@ FILE *outfile;
 static void
 ar_directory_doer (abfd, ignore)
      bfd *abfd;
-     bfd *ignore;
+     bfd *ignore ATTRIBUTE_UNUSED;
 {
     print_arelt_descr(outfile, abfd, verbose);
 }
index 173d62738870824f08de1322d95d095bec8b5c7b..dad45593c8281b8fe4f385588f609989f509bed3 100644 (file)
@@ -1,5 +1,5 @@
 /* debug.c -- Handle generic debugging information.
-   Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -603,7 +603,7 @@ debug_error (message)
 
 static struct debug_name *
 debug_add_to_namespace (info, nsp, name, kind, linkage)
-     struct debug_handle *info;
+     struct debug_handle *info ATTRIBUTE_UNUSED;
      struct debug_namespace **nsp;
      const char *name;
      enum debug_object_kind kind;
@@ -1039,8 +1039,8 @@ debug_record_line (handle, lineno, addr)
 
 boolean
 debug_start_common_block (handle, name)
-     PTR handle;
-     const char *name;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
 {
   /* FIXME */
   debug_error (_("debug_start_common_block: not implemented"));
@@ -1051,8 +1051,8 @@ debug_start_common_block (handle, name)
 
 boolean
 debug_end_common_block (handle, name)
-     PTR handle;
-     const char *name;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
 {
   /* FIXME */
   debug_error (_("debug_end_common_block: not implemented"));
@@ -1143,10 +1143,10 @@ debug_record_typed_const (handle, name, type, val)
 
 boolean
 debug_record_label (handle, name, type, addr)
-     PTR handle;
-     const char *name;
-     debug_type type;
-     bfd_vma addr;
+     PTR handle ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     debug_type type ATTRIBUTE_UNUSED;
+     bfd_vma addr ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   debug_error (_("debug_record_label not implemented"));
@@ -1219,7 +1219,7 @@ debug_record_variable (handle, name, type, kind, val)
 /*ARGSUSED*/
 static struct debug_type *
 debug_make_type (info, kind, size)
-     struct debug_handle *info;
+     struct debug_handle *info ATTRIBUTE_UNUSED;
      enum debug_type_kind kind;
      unsigned int size;
 {
@@ -1781,7 +1781,7 @@ debug_make_undefined_tagged_type (handle, name, kind)
 /*ARGSUSED*/
 debug_baseclass
 debug_make_baseclass (handle, type, bitpos, virtual, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_type type;
      bfd_vma bitpos;
      boolean virtual;
@@ -1809,7 +1809,7 @@ debug_make_baseclass (handle, type, bitpos, virtual, visibility)
 /*ARGSUSED*/
 debug_field
 debug_make_field (handle, name, type, bitpos, bitsize, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_type type;
      bfd_vma bitpos;
@@ -1840,7 +1840,7 @@ debug_make_field (handle, name, type, bitpos, bitsize, visibility)
 /*ARGSUSED*/
 debug_field
 debug_make_static_member (handle, name, type, physname, visibility)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_type type;
      const char *physname;
@@ -1866,7 +1866,7 @@ debug_make_static_member (handle, name, type, physname, visibility)
 /*ARGSUSED*/
 debug_method
 debug_make_method (handle, name, variants)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *name;
      debug_method_variant *variants;
 {
@@ -1894,7 +1894,7 @@ debug_make_method (handle, name, variants)
 debug_method_variant
 debug_make_method_variant (handle, physname, type, visibility, constp,
                           volatilep, voffset, context)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *physname;
      debug_type type;
      enum debug_visibility visibility;
@@ -1926,7 +1926,7 @@ debug_make_method_variant (handle, physname, type, visibility, constp,
 debug_method_variant
 debug_make_static_method_variant (handle, physname, type, visibility,
                                  constp, volatilep)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      const char *physname;
      debug_type type;
      enum debug_visibility visibility;
@@ -2058,7 +2058,7 @@ debug_tag_type (handle, name, type)
 /*ARGSUSED*/
 boolean
 debug_record_type_size (handle, type, size)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_type type;
      unsigned int size;
 {
@@ -2394,7 +2394,7 @@ debug_get_fields (handle, type)
 /*ARGSUSED*/
 debug_type
 debug_get_field_type (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2407,7 +2407,7 @@ debug_get_field_type (handle, field)
 /*ARGSUSED*/
 const char *
 debug_get_field_name (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2420,7 +2420,7 @@ debug_get_field_name (handle, field)
 /*ARGSUSED*/
 bfd_vma
 debug_get_field_bitpos (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || field->static_member)
@@ -2433,7 +2433,7 @@ debug_get_field_bitpos (handle, field)
 /*ARGSUSED*/
 bfd_vma
 debug_get_field_bitsize (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || field->static_member)
@@ -2446,7 +2446,7 @@ debug_get_field_bitsize (handle, field)
 /*ARGSUSED*/
 enum debug_visibility
 debug_get_field_visibility (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL)
@@ -2458,7 +2458,7 @@ debug_get_field_visibility (handle, field)
 
 const char *
 debug_get_field_physname (handle, field)
-     PTR handle;
+     PTR handle ATTRIBUTE_UNUSED;
      debug_field field;
 {
   if (field == NULL || ! field->static_member)
@@ -2598,7 +2598,7 @@ debug_write_type (info, fns, fhandle, type, name)
 {
   unsigned int i;
   int is;
-  const char *tag;
+  const char *tag = NULL;
 
   /* If we have a name for this type, just output it.  We only output
      typedef names after they have been defined.  We output type tags
@@ -2648,7 +2648,6 @@ debug_write_type (info, fns, fhandle, type, name)
   if (name != NULL)
     name->mark = info->mark;
 
-  tag = NULL;
   if (name != NULL
       && type->kind != DEBUG_KIND_NAMED
       && type->kind != DEBUG_KIND_TAGGED)
index 58b52ba748987794f9434c36fddf320d7b91a34c..f9811bc4926c25932810fecb49e9acf208fd3c36 100644 (file)
@@ -1,5 +1,5 @@
 /* filemode.c -- make a string describing file modes
-   Copyright (C) 1985, 90, 91, 94, 95, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1985, 90, 91, 94, 95, 97, 1999 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -230,8 +230,8 @@ ftypelet (bits)
 
 static void
 setst (bits, chars)
-     unsigned long bits;
-     char *chars;
+     unsigned long bits ATTRIBUTE_UNUSED;
+     char *chars ATTRIBUTE_UNUSED;
 {
 #ifdef S_ISUID
   if (bits & S_ISUID)
index 17a5b8821318ea788721f30a4c6e60920c15df15..c03692821a40f029d7704f6f398d69a8f23c20b8 100644 (file)
@@ -1,5 +1,5 @@
 /* ieee.c -- Read and write IEEE-695 debugging information.
-   Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -4104,7 +4104,7 @@ static const struct debug_write_fns ieee_fns =
 /*ARGSUSED*/
 static boolean
 ieee_init_buffer (info, buflist)
-     struct ieee_handle *info;
+     struct ieee_handle *info ATTRIBUTE_UNUSED;
      struct ieee_buflist *buflist;
 {
   buflist->head = NULL;
@@ -4145,7 +4145,7 @@ ieee_change_buffer (info, buflist)
 /*ARGSUSED*/
 static boolean
 ieee_append_buffer (info, mainbuf, newbuf)
-     struct ieee_handle *info;
+     struct ieee_handle *info ATTRIBUTE_UNUSED;
      struct ieee_buflist *mainbuf;
      struct ieee_buflist *newbuf;
 {
@@ -5135,7 +5135,7 @@ ieee_finish_compilation_unit (info)
 
 static void
 ieee_add_bb11_blocks (abfd, sec, data)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
      PTR data;
 {
@@ -5258,8 +5258,8 @@ ieee_add_bb11 (info, sec, low, high)
 /*ARGSUSED*/
 static boolean
 ieee_start_source (p, filename)
-     PTR p;
-     const char *filename;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *filename ATTRIBUTE_UNUSED;
 {
   return true;
 }
@@ -5725,7 +5725,7 @@ ieee_array_type (p, low, high, stringp)
      PTR p;
      bfd_signed_vma low;
      bfd_signed_vma high;
-     boolean stringp;
+     boolean stringp ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
   unsigned int eleindx;
@@ -5792,7 +5792,7 @@ ieee_array_type (p, low, high, stringp)
 static boolean
 ieee_set_type (p, bitstringp)
      PTR p;
-     boolean bitstringp;
+     boolean bitstringp ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
   boolean localp;
@@ -7012,7 +7012,7 @@ ieee_typdef (p, name)
 static boolean
 ieee_tag (p, name)
      PTR p;
-     const char *name;
+     const char *name ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
@@ -7026,9 +7026,9 @@ ieee_tag (p, name)
 
 static boolean
 ieee_int_constant (p, name, val)
-     PTR p;
-     const char *name;
-     bfd_vma val;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     bfd_vma val ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   return true;
@@ -7038,9 +7038,9 @@ ieee_int_constant (p, name, val)
 
 static boolean
 ieee_float_constant (p, name, val)
-     PTR p;
-     const char *name;
-     double val;
+     PTR p ATTRIBUTE_UNUSED;
+     const char *name ATTRIBUTE_UNUSED;
+     double val ATTRIBUTE_UNUSED;
 {
   /* FIXME.  */
   return true;
@@ -7051,8 +7051,8 @@ ieee_float_constant (p, name, val)
 static boolean
 ieee_typed_constant (p, name, val)
      PTR p;
-     const char *name;
-     bfd_vma val;
+     const char *name ATTRIBUTE_UNUSED;
+     bfd_vma val ATTRIBUTE_UNUSED;
 {
   struct ieee_handle *info = (struct ieee_handle *) p;
 
index c51b7fbcc40bc818cdd4174a00a2f107be42d6cd..884f0b8105bf2569fbbd0a6e8e798da48a5ec66d 100644 (file)
@@ -1305,13 +1305,13 @@ print_archive_filename_bsd (filename)
 
 static void
 print_archive_filename_sysv (filename)
-     char *filename;
+     char *filename ATTRIBUTE_UNUSED;
 {
 }
 
 static void
 print_archive_filename_posix (filename)
-     char *filename;
+     char *filename ATTRIBUTE_UNUSED;
 {
 }
 \f
@@ -1319,7 +1319,7 @@ print_archive_filename_posix (filename)
 
 static void
 print_archive_member_bsd (archive, filename)
-     char *archive;
+     char *archive ATTRIBUTE_UNUSED;
      CONST char *filename;
 {
   if (!filename_per_symbol)
index 53bd996fb48e7e5a582d611e68137356473c2645..6137f1139b1ea0499ea98404dca5c2b8bea5c4ca 100644 (file)
@@ -467,7 +467,7 @@ is_specified_symbol (name, list)
 
 static boolean
 is_strip_section (abfd, sec)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
 {
   struct section_list *p;
@@ -605,7 +605,7 @@ filter_bytes (memhunk, size)
 
   for (; from < end; from += interleave)
     *to++ = *from;
-  if (*size % interleave > copy_byte)
+  if (*size % interleave > (bfd_size_type) copy_byte)
     *size = (*size / interleave) + 1;
   else
     *size /= interleave;
@@ -1360,7 +1360,7 @@ copy_section (ibfd, isection, obfdarg)
 
 static void
 get_sections (obfd, osection, secppparg)
-     bfd *obfd;
+     bfd *obfd ATTRIBUTE_UNUSED;
      asection *osection;
      PTR secppparg;
 {
@@ -1467,8 +1467,8 @@ static boolean
 write_debugging_info (obfd, dhandle, symcountp, symppp)
      bfd *obfd;
      PTR dhandle;
-     long *symcountp;
-     asymbol ***symppp;
+     long *symcountp ATTRIBUTE_UNUSED;
+     asymbol ***symppp ATTRIBUTE_UNUSED;
 {
   if (bfd_get_flavour (obfd) == bfd_target_ieee_flavour)
     return write_ieee_debugging_info (obfd, dhandle);
@@ -1807,15 +1807,21 @@ copy_main (argc, argv)
            const char *s;
            int len;
            char *name;
-           char *option;
+           char *option = NULL;
            bfd_vma val;
-           enum change_action what;
+           enum change_action what = CHANGE_IGNORE;
            
            switch (c)
              {
-             case OPTION_CHANGE_SECTION_ADDRESS: option = "--change-section-address"; break;
-             case OPTION_CHANGE_SECTION_LMA: option = "--change-section-lma"; break;
-             case OPTION_CHANGE_SECTION_VMA: option = "--change-section-vma"; break;
+             case OPTION_CHANGE_SECTION_ADDRESS:
+               option = "--change-section-address";
+               break;
+             case OPTION_CHANGE_SECTION_LMA:
+               option = "--change-section-lma";
+               break;
+             case OPTION_CHANGE_SECTION_VMA:
+               option = "--change-section-vma";
+               break;
              }
            
            s = strchr (optarg, '=');
index b7ee5d6283af1c899a348ecc89f0da33ff39bfa0..1cd5fb671c35ebfb898dc9582821fd9699647321 100644 (file)
@@ -289,9 +289,9 @@ static struct option long_options[]=
 \f
 static void
 dump_section_header (abfd, section, ignored)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      asection *section;
-     PTR ignored;
+     PTR ignored ATTRIBUTE_UNUSED;
 {
   char *comma = "";
 
@@ -1139,7 +1139,7 @@ objdump_sprintf (va_alist)
 
   n = strlen (buf);
 
-  while ((f->buffer + f->size) - f->current < n + 1)
+  while ((size_t) ((f->buffer + f->size) - f->current) < n + 1)
     {
       size_t curroff;
 
@@ -1319,7 +1319,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
            }
          else
            {
-             long j;
+             bfd_vma j;
 
              bytes = bytes_per_line;
              if (i + bytes > stop)
@@ -1339,7 +1339,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
              ? show_raw_insn > 0
              : show_raw_insn >= 0)
            {
-             long j;
+             bfd_vma j;
 
              /* If ! prefix_addresses and ! wide_output, we print
                  bytes_per_line bytes per line.  */
@@ -1399,7 +1399,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
            {
              while (pb < bytes)
                {
-                 long j;
+                 bfd_vma j;
                  char *s;
 
                  putchar ('\n');
@@ -1871,7 +1871,7 @@ static void
 print_section_stabs (abfd, stabsect_name, strsect_name)
      bfd *abfd;
      const char *stabsect_name;
-     const char *strsect_name;
+     const char *strsect_name ATTRIBUTE_UNUSED;
 {
   int i;
   unsigned file_string_table_offset = 0, next_file_string_table_offset = 0;
@@ -2227,7 +2227,7 @@ dump_data (abfd)
 /* Should perhaps share code and display with nm? */
 static void
 dump_symbols (abfd, dynamic)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      boolean dynamic;
 {
   asymbol **current;
index 958cbd2c6bfc8e55e530e1c692fd99f5ba4b386f..abd684dfeb0709ab5c65ab20d71076d799419755 100644 (file)
@@ -1,5 +1,5 @@
 /* prdbg.c -- Print out generic debugging information.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -985,7 +985,7 @@ pr_fix_visibility (info, visibility)
      struct pr_handle *info;
      enum debug_visibility visibility;
 {
-  const char *s;
+  const char *s = NULL;
   char *t;
   unsigned int len;
 
@@ -1602,7 +1602,7 @@ pr_typdef (p, name)
 static boolean
 pr_tag (p, name)
      PTR p;
-     const char *name;
+     const char *name ATTRIBUTE_UNUSED;
 {
   struct pr_handle *info = (struct pr_handle *) p;
   char *t;
@@ -1856,7 +1856,7 @@ pr_end_block (p, addr)
 /*ARGSUSED*/
 static boolean
 pr_end_function (p)
-     PTR p;
+     PTR p ATTRIBUTE_UNUSED;
 {
   return true;
 }
index ee68bc6d449f39f152c89531ae68ed4c1effbdba..d1ee6e620f5f82eef5460c48d0ebc35b8ce7960a 100644 (file)
@@ -1,5 +1,5 @@
 /* stabs.c -- Parse COFF debugging information
-   Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -498,7 +498,7 @@ static debug_type
 parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
      bfd *abfd;
      struct coff_symbols *symbols;
-     struct coff_types *types;
+     struct coff_types *types ATTRIBUTE_UNUSED;
      union internal_auxent *pauxent;
      PTR dhandle;
 {
@@ -569,7 +569,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
 static boolean
 parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
                   within_function)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      struct coff_types *types;
      asymbol *sym;
      long coff_symno;
index 3c613a6fa4c6ed5ef37f6b339c9328f4ce61ebe6..4b7dc0aca1e33ced5207df252e8fbe192bf77f6d 100644 (file)
@@ -1880,7 +1880,7 @@ process_program_headers (file)
                      ? (section->sh_addr >= segment->p_vaddr
                         && section->sh_addr + section->sh_size
                         <= segment->p_vaddr + segment->p_memsz)
-                     : (section->sh_offset >= segment->p_offset
+                     : ((bfd_vma) section->sh_offset >= segment->p_offset
                         && (section->sh_offset + section->sh_size
                             <= segment->p_offset + segment->p_filesz))))
                printf ("%s ", SECTION_NAME (section));
@@ -2205,7 +2205,7 @@ process_relocs (file)
 
   if (do_using_dynamic)
     {
-      int is_rela;
+      int is_rela = FALSE;
 
       rel_size   = 0;
       rel_offset = 0;
@@ -3549,7 +3549,7 @@ process_symbol_table (file)
   Elf32_Internal_Shdr *   section;
   char   nb [4];
   char   nc [4];
-  int    nbuckets;
+  int    nbuckets = 0;
   int    nchains;
   int *  buckets = NULL;
   int *  chains = NULL;
@@ -3884,9 +3884,9 @@ process_symbol_table (file)
 
 static int
 process_syminfo (file)
-     FILE * file;
+     FILE * file ATTRIBUTE_UNUSED;
 {
-  int i;
+  unsigned int i;
 
   if (dynamic_syminfo == NULL
       || !do_dynamic)
@@ -4179,7 +4179,7 @@ static int
 display_debug_lines (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   DWARF2_External_LineInfo * external;
   DWARF2_Internal_LineInfo   info;
@@ -4399,7 +4399,7 @@ static int
 display_debug_pubnames (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   DWARF2_External_PubNames * external;
   DWARF2_Internal_PubNames   pubnames;
@@ -4821,7 +4821,7 @@ static int
 display_debug_abbrev (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   abbrev_entry * entry;
   unsigned char * end = start + section->sh_size;
@@ -5343,8 +5343,8 @@ read_and_display_attr (attribute, form, data, pointer_size)
      unsigned char * data;
      unsigned long   pointer_size;
 {
-  unsigned long   uvalue;
-  unsigned char * block_start;
+  unsigned long   uvalue = 0;
+  unsigned char * block_start = NULL;
   int             bytes_read;
   int            is_ref = 0;
 
@@ -5665,7 +5665,7 @@ display_debug_info (section, start, file)
       while (tags < start)
        {
          int            bytes_read;
-         int            abbrev_number;
+         unsigned long  abbrev_number;
          abbrev_entry * entry;
          abbrev_attr  * attr;
 
@@ -5688,12 +5688,12 @@ display_debug_info (section, start, file)
 
          if (entry == NULL)
            {
-             warn (_("Unable to locate entry %d in the abbreviation table\n"),
+             warn (_("Unable to locate entry %lu in the abbreviation table\n"),
                    abbrev_number);
              return 0;
            }
 
-         printf (_(" <%d><%x>: Abbrev Number: %d (%s)\n"),
+         printf (_(" <%d><%x>: Abbrev Number: %lu (%s)\n"),
                  level, tags - section_begin - bytes_read,
                  abbrev_number,
                  get_TAG_name (entry->tag));
@@ -5718,7 +5718,7 @@ static int
 display_debug_aranges (section, start, file)
      Elf32_Internal_Shdr * section;
      unsigned char *       start;
-     FILE *                file;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   unsigned char * end = start + section->sh_size;
 
@@ -5778,8 +5778,8 @@ display_debug_aranges (section, start, file)
 static int
 display_debug_not_supported (section, start, file)
      Elf32_Internal_Shdr * section;
-     unsigned char *       start;
-     FILE *                file;
+     unsigned char *       start ATTRIBUTE_UNUSED;
+     FILE *                file ATTRIBUTE_UNUSED;
 {
   printf (_("Displaying the debug contents of section %s is not yet supported.\n"),
            SECTION_NAME (section));
@@ -5991,7 +5991,7 @@ process_mips_specific (file)
                  { " DELTA", LL_DELTA }
                };
              int flags = liblist.l_flags;
-             int fcnt;
+             size_t fcnt;
 
              for (fcnt = 0;
                   fcnt < sizeof (l_flags_vals) / sizeof (l_flags_vals[0]);
index f57c7eda9b0e107d2249d762ae9da413ccd3a807..c93850c6a186ea37493854e075309580a1bb5374 100644 (file)
@@ -366,9 +366,9 @@ static bfd_size_type textsize;
 
 static void
 berkeley_sum (abfd, sec, ignore)
-     bfd *abfd;
+     bfd *abfd ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   flagword flags;
   bfd_size_type size;
@@ -433,9 +433,9 @@ int svi_sizelen = 0;
 
 static void
 sysv_internal_sizer (file, sec, ignore)
-     bfd *file;
+     bfd *file ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   bfd_size_type size = bfd_section_size (file, sec);
   if (!bfd_is_abs_section (sec)
@@ -454,9 +454,9 @@ sysv_internal_sizer (file, sec, ignore)
 
 static void
 sysv_internal_printer (file, sec, ignore)
-     bfd *file;
+     bfd *file ATTRIBUTE_UNUSED;
      sec_ptr sec;
-     PTR ignore;
+     PTR ignore ATTRIBUTE_UNUSED;
 {
   bfd_size_type size = bfd_section_size (file, sec);
   if (!bfd_is_abs_section (sec)
index 945f87645ecdff7f25b858e4a59b644dccf186dd..53e1070c8bcdd7beb09c313a70a7816c5c670e42 100644 (file)
@@ -375,7 +375,7 @@ warn_stab (p, err)
 /*ARGSUSED*/
 PTR
 start_stab (dhandle, abfd, sections, syms, symcount)
-     PTR dhandle;
+     PTR dhandle ATTRIBUTE_UNUSED;
      bfd *abfd;
      boolean sections;
      asymbol **syms;
@@ -1818,7 +1818,7 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums)
            return debug_make_int_type (dhandle, 1, true);
          else if (n3 == 0xffff)
            return debug_make_int_type (dhandle, 2, true);
-         else if (n3 == 0xffffffff)
+         else if (n3 == (bfd_signed_vma) 0xffffffff)
            return debug_make_int_type (dhandle, 4, true);
 #ifdef BFD64
          else if (n3 == ((((bfd_vma) 0xffffffff) << 32) | 0xffffffff))
@@ -3439,7 +3439,7 @@ stab_find_type (dhandle, info, typenums)
 
 static boolean
 stab_record_type (dhandle, info, typenums, type)
-     PTR dhandle;
+     PTR dhandle ATTRIBUTE_UNUSED;
      struct stab_handle *info;
      const int *typenums;
      debug_type type;
@@ -4513,7 +4513,7 @@ stab_demangle_template (minfo, pp, pname)
 
 static boolean
 stab_demangle_class (minfo, pp, pstart)
-     struct stab_demangle_info *minfo;
+     struct stab_demangle_info *minfo ATTRIBUTE_UNUSED;
      const char **pp;
      const char **pstart;
 {
index e428174f5b2e38c9b5c58da3008821f6c3c54030..8b51587589585c7d92d03cdd1483c86d13270ac2 100644 (file)
@@ -1,5 +1,5 @@
 /* wrstabs.c -- Output stabs debugging information
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
    This file is part of GNU Binutils.
@@ -984,7 +984,7 @@ static boolean
 stab_function_type (p, argcount, varargs)
      PTR p;
      int argcount;
-     boolean varargs;
+     boolean varargs ATTRIBUTE_UNUSED;
 {
   struct stab_write_handle *info = (struct stab_write_handle *) p;
   int i;
@@ -2383,7 +2383,7 @@ stab_end_block (p, addr)
 /*ARGSUSED*/
 static boolean
 stab_end_function (p)
-     PTR p;
+     PTR p ATTRIBUTE_UNUSED;
 {
   return true;
 }