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-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
find_address_in_section (abfd, section, data)
bfd *abfd;
asection *section;
- PTR data;
+ PTR data ATTRIBUTE_UNUSED;
{
bfd_vma vma;
bfd_size_type size;
static int
yyerror (x)
- const char *x;
+ const char *x ATTRIBUTE_UNUSED;
{
extern int linenumber;
/* 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.
static void
ar_directory_doer (abfd, ignore)
bfd *abfd;
- bfd *ignore;
+ bfd *ignore ATTRIBUTE_UNUSED;
{
print_arelt_descr(outfile, abfd, verbose);
}
/* 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.
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;
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"));
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"));
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"));
/*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;
{
/*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;
/*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;
/*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;
/*ARGSUSED*/
debug_method
debug_make_method (handle, name, variants)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
const char *name;
debug_method_variant *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;
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;
/*ARGSUSED*/
boolean
debug_record_type_size (handle, type, size)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_type type;
unsigned int size;
{
/*ARGSUSED*/
debug_type
debug_get_field_type (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL)
/*ARGSUSED*/
const char *
debug_get_field_name (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL)
/*ARGSUSED*/
bfd_vma
debug_get_field_bitpos (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL || field->static_member)
/*ARGSUSED*/
bfd_vma
debug_get_field_bitsize (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL || field->static_member)
/*ARGSUSED*/
enum debug_visibility
debug_get_field_visibility (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL)
const char *
debug_get_field_physname (handle, field)
- PTR handle;
+ PTR handle ATTRIBUTE_UNUSED;
debug_field field;
{
if (field == NULL || ! field->static_member)
{
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
if (name != NULL)
name->mark = info->mark;
- tag = NULL;
if (name != NULL
&& type->kind != DEBUG_KIND_NAMED
&& type->kind != DEBUG_KIND_TAGGED)
/* 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
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)
/* 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.
/*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;
/*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;
{
static void
ieee_add_bb11_blocks (abfd, sec, data)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
PTR data;
{
/*ARGSUSED*/
static boolean
ieee_start_source (p, filename)
- PTR p;
- const char *filename;
+ PTR p ATTRIBUTE_UNUSED;
+ const char *filename ATTRIBUTE_UNUSED;
{
return true;
}
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;
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;
static boolean
ieee_tag (p, name)
PTR p;
- const char *name;
+ const char *name ATTRIBUTE_UNUSED;
{
struct ieee_handle *info = (struct ieee_handle *) p;
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;
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;
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;
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
static void
print_archive_member_bsd (archive, filename)
- char *archive;
+ char *archive ATTRIBUTE_UNUSED;
CONST char *filename;
{
if (!filename_per_symbol)
static boolean
is_strip_section (abfd, sec)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
{
struct section_list *p;
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;
static void
get_sections (obfd, osection, secppparg)
- bfd *obfd;
+ bfd *obfd ATTRIBUTE_UNUSED;
asection *osection;
PTR secppparg;
{
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);
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, '=');
\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 = "";
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;
}
else
{
- long j;
+ bfd_vma j;
bytes = bytes_per_line;
if (i + bytes > stop)
? 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. */
{
while (pb < bytes)
{
- long j;
+ bfd_vma j;
char *s;
putchar ('\n');
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;
/* Should perhaps share code and display with nm? */
static void
dump_symbols (abfd, dynamic)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
boolean dynamic;
{
asymbol **current;
/* 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.
struct pr_handle *info;
enum debug_visibility visibility;
{
- const char *s;
+ const char *s = NULL;
char *t;
unsigned int len;
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;
/*ARGSUSED*/
static boolean
pr_end_function (p)
- PTR p;
+ PTR p ATTRIBUTE_UNUSED;
{
return true;
}
/* 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.
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;
{
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;
? (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));
if (do_using_dynamic)
{
- int is_rela;
+ int is_rela = FALSE;
rel_size = 0;
rel_offset = 0;
Elf32_Internal_Shdr * section;
char nb [4];
char nc [4];
- int nbuckets;
+ int nbuckets = 0;
int nchains;
int * buckets = NULL;
int * chains = NULL;
static int
process_syminfo (file)
- FILE * file;
+ FILE * file ATTRIBUTE_UNUSED;
{
- int i;
+ unsigned int i;
if (dynamic_syminfo == NULL
|| !do_dynamic)
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;
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;
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;
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;
while (tags < start)
{
int bytes_read;
- int abbrev_number;
+ unsigned long abbrev_number;
abbrev_entry * entry;
abbrev_attr * attr;
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));
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;
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));
{ " 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]);
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;
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)
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)
/*ARGSUSED*/
PTR
start_stab (dhandle, abfd, sections, syms, symcount)
- PTR dhandle;
+ PTR dhandle ATTRIBUTE_UNUSED;
bfd *abfd;
boolean sections;
asymbol **syms;
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))
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;
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;
{
/* 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.
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;
/*ARGSUSED*/
static boolean
stab_end_function (p)
- PTR p;
+ PTR p ATTRIBUTE_UNUSED;
{
return true;
}