Add -Wuninitialized to default warning list.
@ -1,3 +1,22 @@
2001-03-28 Andrew Cagney <ac131313@redhat.com>
* configure.in (build_warnings): Add -Wuninitialized.
* configure: Regenerate.
* v850-tdep.c (v850_scan_prologue): Initialize ``insn2''.
* sparc-tdep.c (sparc64_push_arguments): Add default case to
switch.
* sh-tdep.c (sh_do_fp_register): Replace ``?:'' printf format
expression with if statement.
* mn10200-tdep.c (mn10200_analyze_prologue): Initialize
``stack_size''.
* mips-tdep.c (show_mipsfpu_command): Add default case to switch.
(mips_dump_tdep): Fix setting of ef_mips_arch.
* mcore-tdep.c (mcore_analyze_prologue): Initialize ``fp_regnum''.
* dsrec.c (make_srec): Always initialize ``binbuf''.
* monitor.c (monitor_read_memory_single): Do not pass an
uninitialized buffer to monitor_error. Make ``i'' more local.
* MAINTAINERS: Change ns32k target to ,-Werror.
@ -652,10 +652,10 @@ fi
# NOTE: If you add to this list, remember to update
# gdb/doc/gdbint.texinfo.
build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
-Wformat -Wparentheses -Wpointer-arith"
-Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
# -Wchar-subscripts -Wuninitialized -Wtraditional -Wshadow -Wcast-qual
# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
# -Woverloaded-virtual -Winline -Werror"
@ -242,6 +242,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
{
tmp = flags >> SREC_TERM_SHIFT; /* Term record */
code_table = term_code_table;
binbuf = NULL;
}
if ((tmp & SREC_2_BYTE_ADDR) && (targ_addr <= 0xffff))
@ -251,7 +251,9 @@ mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc, int skip_prologue)
CORE_ADDR func_addr, func_end, addr, stop;
CORE_ADDR stack_size;
int insn, rn;
int status, fp_regnum, flags;
int status;
int fp_regnum = 0; /* dummy, valid when (flags & MY_FRAME_IN_FP) */
int flags;
int framesize;
int register_offsets[NUM_REGS];
char *name;
@ -3292,6 +3292,8 @@ show_mipsfpu_command (char *args, int from_tty)
case MIPS_FPU_NONE:
fpu = "absent (none)";
break;
default:
internal_error (__FILE__, __LINE__, "bad switch");
if (mips_fpu_type_auto)
printf_unfiltered ("The MIPS floating-point coprocessor is set automatically (currently %s)\n",
@ -4157,9 +4159,10 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
ef_mips_arch = 3;
case E_MIPS_ARCH_4:
ef_mips_arch = 0;
ef_mips_arch = 4;
/* determine the size of a pointer */
@ -114,7 +114,7 @@ static CORE_ADDR
mn10200_analyze_prologue (struct frame_info *fi, CORE_ADDR pc)
CORE_ADDR stack_size = 0;
unsigned char buf[4];
@ -1691,7 +1691,6 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
char membuf[sizeof (int) * 2 + 1];
char *p;
char *cmd;
int i;
monitor_debug ("MON read single\n");
#if 0
@ -1751,29 +1750,31 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
else
monitor_error ("monitor_read_memory_single",
"bad response from monitor",
memaddr, i, membuf, c);
memaddr, 0, NULL, 0);
for (i = 0; i < len * 2; i++)
int c;
while (1)
c = readchar (timeout);
if (isxdigit (c))
if (c == ' ')
continue;
memaddr, i, membuf, 0);
membuf[i] = c;
membuf[i] = '\000'; /* terminate the number */
/* If TERM is present, we wait for that to show up. Also, (if TERM is
present), we will send TERM_CMD if that is present. In any case, we collect
@ -1766,7 +1766,10 @@ sh_do_fp_register (int regnum)
print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout);
/* Print the value. */
printf_filtered (inv ? "<invalid float>" : "%-10.9g", flt);
if (inv)
printf_filtered ("<invalid float>");
printf_filtered ("%-10.9g", flt);
/* Print the fp register as hex. */
printf_filtered ("\t(raw 0x");
@ -2381,6 +2381,8 @@ sparc64_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp,
fpreg = FP0_REGNUM + 2 * register_counter;
register_counter += 2;
write_register_bytes (REGISTER_BYTE (fpreg),
VALUE_CONTENTS (args[i]),
@ -356,7 +356,8 @@ v850_scan_prologue (CORE_ADDR pc, struct prologue_info *pi)
for (current_pc = func_addr; current_pc < prologue_end;)
int insn, insn2;
int insn;
int insn2 = -1; /* dummy value */
#ifdef DEBUG
printf_filtered ("0x%.8lx ", (long) current_pc);