+1999-07-11 Ian Lance Taylor <ian@zembu.com>
+
+ * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
+ as appropriate. Fill in structure initializations. Add variable
+ initializations. Add casts.
+ * dwarf2dbg.c (print_stats): Change i to size_t.
+ * listing.c (listing_listing): Change list_line to unsigned int.
+
1999-07-10 Ian Lance Taylor <ian@zembu.com>
* config/tc-ppc.h (tc_fix_adjustable) [OBJ_ELF]: Call S_IS_LOCAL
saved_input = NULL;
else
{
- assert (saved->saved_input_len <= sizeof input_buffer);
+ assert (saved->saved_input_len <= (int) (sizeof input_buffer));
memcpy (input_buffer, saved->saved_input, saved->saved_input_len);
saved_input = input_buffer;
saved_input_len = saved->saved_input_len;
void
s_endif (arg)
- int arg;
+ int arg ATTRIBUTE_UNUSED;
{
struct conditional_frame *hold;
void
s_else (arg)
- int arg;
+ int arg ATTRIBUTE_UNUSED;
{
if (current_cframe == NULL)
{
{"text", obj_elf_text, 0},
/* End sentinel. */
- {NULL},
+ {NULL, NULL, 0},
};
static const pseudo_typeS ecoff_debug_pseudo_table[] =
{ "vreg", s_ignore, 0 },
#endif
- {NULL} /* end sentinel */
+ {NULL, NULL, 0} /* end sentinel */
};
#undef NO_RELOC
}
if (S_GET_VALUE (symbolP) != 0)
{
- if (S_GET_VALUE (symbolP) != size)
+ if (S_GET_VALUE (symbolP) != (valueT) size)
{
as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."),
S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
static void
obj_elf_local (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
int c;
static void
obj_elf_weak (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
int c;
static void
obj_elf_subsection (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register int temp;
void
obj_elf_previous (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
segT new_section;
int new_subsection;
static void
obj_elf_popsection (xxx)
- int xxx;
+ int xxx ATTRIBUTE_UNUSED;
{
struct section_stack *top = section_stack;
static void
obj_elf_line (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
/* Assume delimiter is part of expression. BSD4.2 as fails with
delightful bug, so we are not being incompatible here. */
static void
obj_elf_symver (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
char c;
static void
obj_elf_vtable_inherit (ignore)
+ int ignore ATTRIBUTE_UNUSED;
{
char *cname, *pname;
symbolS *csym, *psym;
static void
obj_elf_vtable_entry (ignore)
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
symbolS *sym;
void
obj_elf_version (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
unsigned int c;
static void
obj_elf_size (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name = input_line_pointer;
char c = get_symbol_end ();
static void
obj_elf_type (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
char c;
static void
obj_elf_ident (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
static segT comment_section;
segT old_section = now_seg;
adjust_stab_sections (abfd, sec, xxx)
bfd *abfd;
asection *sec;
- PTR xxx;
+ PTR xxx ATTRIBUTE_UNUSED;
{
char *name;
asection *strsec;
&& (strncmp (mnemonic, "fsub", 4) !=0)
&& (strncmp (mnemonic, "fdiv", 4) !=0))
{
- const reg_entry *temp_reg;
- expressionS *temp_disp;
- expressionS *temp_imm;
+ const reg_entry *temp_reg = NULL;
+ expressionS *temp_disp = NULL;
+ expressionS *temp_imm = NULL;
unsigned int temp_type;
- int xchg1, xchg2;
+ int xchg1 = 0;
+ int xchg2 = 0;
if (i.operands == 2)
{
if (cp != NULL)
{
char *tmpbuf;
- int len, first;
+ int len = 0;
+ int first;
/* GOT relocations are not supported in 16 bit mode */
if (flag_16bit_code)
if (cp != NULL)
{
char *tmpbuf;
- int len, first;
+ int len = 0;
+ int first;
/* GOT relocations are not supported in 16 bit mode */
if (flag_16bit_code)
int found_base_index_form;
/* Start and end of displacement string expression (if found). */
- char *displacement_string_start;
- char *displacement_string_end;
+ char *displacement_string_start = NULL;
+ char *displacement_string_end = NULL;
do_memory_reference:
#else
void
md_convert_frag (abfd, sec, fragP)
- bfd *abfd;
- segT sec;
+ bfd *abfd ATTRIBUTE_UNUSED;
+ segT sec ATTRIBUTE_UNUSED;
register fragS *fragP;
#endif
{
md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol)
char *ptr;
addressT from_addr, to_addr;
- fragS *frag;
- symbolS *to_symbol;
+ fragS *frag ATTRIBUTE_UNUSED;
+ symbolS *to_symbol ATTRIBUTE_UNUSED;
{
long offset;
int
md_parse_option (c, arg)
int c;
- char *arg;
+ char *arg ATTRIBUTE_UNUSED;
{
switch (c)
{
/* Round up a section size to the appropriate boundary. */
valueT
md_section_align (segment, size)
- segT segment;
+ segT segment ATTRIBUTE_UNUSED;
valueT size;
{
#ifdef OBJ_AOUT
static void
s_bss (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register int temp;
arelent *
tc_gen_reloc (section, fixp)
- asection *section;
+ asection *section ATTRIBUTE_UNUSED;
fixS *fixp;
{
arelent *rel;
{
INITIAL_STATE
},
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ NULL,
+ { NULL, 0, 0, 0, 0 },
+ 0,
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }
};
int i, last = filenum - 1;
char char0 = file[0];
- if ((unsigned) last >= ls.num_filenames)
+ if (last >= ls.num_filenames)
last = ls.last_filename;
/* do a quick check against the previously used filename: */
if (filenum > 0 && !l->filename)
{
- if (filenum >= ls.num_filenames)
+ if (filenum >= (unsigned int) ls.num_filenames)
{
as_warn ("Encountered bad file number in line number debug info!");
return;
"set_column", "negate_stmt", "set_basic_block", "const_add_pc",
"fixed_advance_pc"
};
- int i, j;
+ size_t i;
+ int j;
fprintf (stderr, "Average size: %g bytes/line\n",
total_size / (double) ls.num_line_entries);
void
dwarf2_directive_file (dummy)
- int dummy;
+ int dummy ATTRIBUTE_UNUSED;
{
int len;
void
dwarf2_directive_loc (dummy)
- int dummy;
+ int dummy ATTRIBUTE_UNUSED;
{
ls.any_dwarf2_directives = 1;
void
hash_print_statistics (f, name, table)
- FILE *f;
- const char *name;
- struct hash_control *table;
+ FILE *f ATTRIBUTE_UNUSED;
+ const char *name ATTRIBUTE_UNUSED;
+ struct hash_control *table ATTRIBUTE_UNUSED;
{
#ifdef HASH_STATISTICS
unsigned int i;
static void
listing_listing (name)
- char *name;
+ char *name ATTRIBUTE_UNUSED;
{
list_info_type *list = head;
file_info_type *current_hll_file = (file_info_type *) NULL;
while (list)
{
- int list_line;
+ unsigned int list_line;
width = listing_rhs_width > paper_width ? paper_width :
listing_rhs_width;
void
listing_eject (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
if (listing)
listing_tail->edict = EDICT_EJECT;
void
listing_flags (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
while ((*input_line_pointer++) && (*input_line_pointer != '\n'))
input_line_pointer++;
void
listing_nopage (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
paper_height = 0;
}
{"xstabs", s_xstab, 's'},
{"word", cons, 2},
{"zero", s_space, 0},
- {NULL} /* end sentinel */
+ {NULL, NULL, 0} /* end sentinel */
};
static int pop_override_ok = 0;
void
s_abort (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
as_fatal (_(".abort detected. Abandoning ship."));
}
void
s_comm (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register char *name;
register char c;
void
s_mri_common (small)
- int small;
+ int small ATTRIBUTE_UNUSED;
{
char *name;
char c;
void
s_data (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
segT section;
register int temp;
void
s_app_line (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
int l;
void
s_end (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
if (flag_mri)
{
void
s_err (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
as_bad (_(".err encountered"));
demand_empty_rest_of_line ();
void
s_fail (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
offsetT temp;
char *stop = NULL;
void
s_fill (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
expressionS rep_exp;
long size = 1;
void
s_globl (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *name;
int c;
void
s_linkonce (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
enum linkonce_type type;
void
s_lsym (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register char *name;
register char c;
void
s_macro (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *file;
unsigned int line;
void
s_mexit (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
cond_exit_macro (macro_nest);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
void
s_mri (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
int on, old_flag;
void
s_org (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register segT segment;
expressionS exp;
void
s_mri_sect (type)
- char *type;
+ char *type ATTRIBUTE_UNUSED;
{
#ifdef TC_M68K
void
s_print (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *s;
int len;
void
s_purgem (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
if (is_it_end_of_statement ())
{
void
s_rept (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
int count;
sb one;
void
s_struct (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
char *stop = NULL;
char stopc;
void
s_text (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
register int temp;
/* ARGSUSED */
void
s_include (arg)
- int arg;
+ int arg ATTRIBUTE_UNUSED;
{
char *newbuf;
char *filename;
\f
void
s_ignore (arg)
- int arg;
+ int arg ATTRIBUTE_UNUSED;
{
while (!is_end_of_line[(unsigned char) *input_line_pointer])
{
void
stabs_generate_asm_endfunc (funcname, startlabname)
- const char *funcname;
+ const char *funcname ATTRIBUTE_UNUSED;
const char *startlabname;
{
static int label_count;
symbolS *addme;
symbolS *target;
symbolS **rootPP;
- symbolS **lastPP;
+ symbolS **lastPP ATTRIBUTE_UNUSED;
{
if (LOCAL_SYMBOL_CHECK (addme))
abort ();
static void
resolve_local_symbol (key, value)
- const char *key;
+ const char *key ATTRIBUTE_UNUSED;
PTR value;
{
if (value != NULL)
static void
renumber_sections (abfd, sec, countparg)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
PTR countparg;
{
static void
chain_frchains_together (abfd, section, xxx)
- bfd *abfd; /* unused */
+ bfd *abfd ATTRIBUTE_UNUSED;
segT section;
- PTR xxx; /* unused */
+ PTR xxx ATTRIBUTE_UNUSED;
{
segment_info_type *info;
relax_and_size_seg (abfd, sec, xxx)
bfd *abfd;
asection *sec;
- PTR xxx;
+ PTR xxx ATTRIBUTE_UNUSED;
{
flagword flags;
fragS *fragp;
static void
adjust_reloc_syms (abfd, sec, xxx)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
- PTR xxx;
+ PTR xxx ATTRIBUTE_UNUSED;
{
segment_info_type *seginfo = seg_info (sec);
fixS *fixp;
write_relocs (abfd, sec, xxx)
bfd *abfd;
asection *sec;
- PTR xxx;
+ PTR xxx ATTRIBUTE_UNUSED;
{
segment_info_type *seginfo = seg_info (sec);
int i;
static void
write_contents (abfd, sec, xxx)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
- PTR xxx;
+ PTR xxx ATTRIBUTE_UNUSED;
{
segment_info_type *seginfo = seg_info (sec);
unsigned long offset = 0;
} /* not a bit fix */
#ifdef TC_VALIDATE_FIX
- skip: ;
+ skip: ATTRIBUTE_UNUSED_LABEL
+ ;
#endif
#ifdef DEBUG5
fprintf (stderr, "result:\n");