* [RFA] Avoid compiler warnings in mips-tdep.c
@ 2001-05-17 7:53 Eli Zaretskii
2001-05-17 20:51 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2001-05-17 7:53 UTC (permalink / raw)
To: gdb-patches
Please consider the following patches to mips-tdep.c, to avoid compiler
warnings and fix one typo in a comment.
2001-05-17 Eli Zaretskii <eliz@is.elta.co.il>
* mips-tdep.c (show_mipsfpu_command): Remove unused variable msg.
(mips_set_processor_type_command): Remove unused variable j.
(mips_breakpoint_from_pc): Declare breakpoint instruction
sequences as unsigned char, to avoid compiler warnings.
--- gdb/mips-tdep.c~0 Wed Mar 28 23:42:31 2001
+++ gdb/mips-tdep.c Tue May 15 15:30:39 2001
@@ -2193,8 +2193,8 @@
don't use float registers for arguments. This duplication of
arguments in general registers can't hurt non-MIPS16 functions
because those registers are normally skipped. */
- /* MIPS_EABI squeeses a struct that contains a single floating
- point value into an FP register instead of pusing it onto the
+ /* MIPS_EABI squeezes a struct that contains a single floating
+ point value into an FP register instead of pushing it onto the
stack. */
if (fp_register_arg_p (typecode, arg_type)
&& float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
@@ -3279,7 +3279,6 @@
static void
show_mipsfpu_command (char *args, int from_tty)
{
- char *msg;
char *fpu;
switch (MIPS_FPU_TYPE)
{
@@ -3387,7 +3386,7 @@
int
mips_set_processor_type (char *str)
{
- int i, j;
+ int i;
if (str == NULL)
return 0;
@@ -3493,7 +3492,8 @@
{
if (pc_is_mips16 (*pcptr))
{
- static char mips16_big_breakpoint[] = MIPS16_BIG_BREAKPOINT;
+ static unsigned char mips16_big_breakpoint[] =
+ MIPS16_BIG_BREAKPOINT;
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_big_breakpoint);
return mips16_big_breakpoint;
@@ -3500,9 +3500,9 @@
}
else
{
- static char big_breakpoint[] = BIG_BREAKPOINT;
- static char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT;
- static char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT;
+ static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
+ static unsigned char pmon_big_breakpoint[] = PMON_BIG_BREAKPOINT;
+ static unsigned char idt_big_breakpoint[] = IDT_BIG_BREAKPOINT;
*lenptr = sizeof (big_breakpoint);
@@ -3520,7 +3520,8 @@
{
if (pc_is_mips16 (*pcptr))
{
- static char mips16_little_breakpoint[] = MIPS16_LITTLE_BREAKPOINT;
+ static unsigned char mips16_little_breakpoint[] =
+ MIPS16_LITTLE_BREAKPOINT;
*pcptr = UNMAKE_MIPS16_ADDR (*pcptr);
*lenptr = sizeof (mips16_little_breakpoint);
return mips16_little_breakpoint;
@@ -3527,9 +3528,11 @@
}
else
{
- static char little_breakpoint[] = LITTLE_BREAKPOINT;
- static char pmon_little_breakpoint[] = PMON_LITTLE_BREAKPOINT;
- static char idt_little_breakpoint[] = IDT_LITTLE_BREAKPOINT;
+ static unsigned char little_breakpoint[] = LITTLE_BREAKPOINT;
+ static unsigned char pmon_little_breakpoint[] =
+ PMON_LITTLE_BREAKPOINT;
+ static unsigned char idt_little_breakpoint[] =
+ IDT_LITTLE_BREAKPOINT;
*lenptr = sizeof (little_breakpoint);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Avoid compiler warnings in mips-tdep.c
2001-05-17 7:53 [RFA] Avoid compiler warnings in mips-tdep.c Eli Zaretskii
@ 2001-05-17 20:51 ` Andrew Cagney
2001-06-04 0:53 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2001-05-17 20:51 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
> Please consider the following patches to mips-tdep.c, to avoid compiler
> warnings and fix one typo in a comment.
>
>
> 2001-05-17 Eli Zaretskii <eliz@is.elta.co.il>
>
> * mips-tdep.c (show_mipsfpu_command): Remove unused variable msg.
> (mips_set_processor_type_command): Remove unused variable j.
> (mips_breakpoint_from_pc): Declare breakpoint instruction
> sequences as unsigned char, to avoid compiler warnings.
Yes, fixes like this one are pretty obvious.
It is only when people introduce things like casts to gag warnings that
I'll start to wonder.
Andrew
PS: Would -Wunused be a good next candidate for -Werror?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] Avoid compiler warnings in mips-tdep.c
2001-05-17 20:51 ` Andrew Cagney
@ 2001-06-04 0:53 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2001-06-04 0:53 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
On Fri, 18 May 2001, Andrew Cagney wrote:
> > Please consider the following patches to mips-tdep.c, to avoid compiler
> > warnings and fix one typo in a comment.
> >
> >
> > 2001-05-17 Eli Zaretskii <eliz@is.elta.co.il>
> >
> > * mips-tdep.c (show_mipsfpu_command): Remove unused variable msg.
> > (mips_set_processor_type_command): Remove unused variable j.
> > (mips_breakpoint_from_pc): Declare breakpoint instruction
> > sequences as unsigned char, to avoid compiler warnings.
>
>
> Yes, fixes like this one are pretty obvious.
Committed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-06-04 0:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-17 7:53 [RFA] Avoid compiler warnings in mips-tdep.c Eli Zaretskii
2001-05-17 20:51 ` Andrew Cagney
2001-06-04 0:53 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox