This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [PATCH] Some compiler warnings removed
- To: Eli Zaretskii <eliz at delorie dot com>
- Subject: Re: [PATCH] Some compiler warnings removed
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 29 Feb 2000 18:45:03 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <200002232235.RAA18817@indy.delorie.com>
Eli Zaretskii wrote:
>
> Here's my share of shutting up "gcc -Wall -W". Is "foo = foo;" an
> okay solution for unused argument foo?
>
> These diffs are against Feb 17 snapshot. I hope they are still
> relevant and apply cleanly.
>
> 2000-02-23 Eli Zaretskii <eliz@is.elta.co.il>
>
> * utils.c [__GO32__]: Include pc.h, for prototypes of ScreenCols
> and ScreenRows.
>
> * ser-go32.c: Include string.h, for prototype of strncasecmp.
> (dpmi_regs, dpmi_sregs): Remove unused variables.
> (dos_flush_input): Return a value, to prevent compiler warning.
>
> * main.c (captured_command_loop): Prevent gcc from complaining
> about unused argument.
>
> * gdbtypes.c (count_virtual_fns): Make sure vfuncs is initialized
> to zero.
>
> * expprint.c (dump_prefix_expression): Use %ld in format and cast
> sizeof(union exp_element) to long, to prevent GCC from complaining
> about format/argument mismatch.
> (dump_postfix_expression): Likewise.
>
> * blockframe.c (nonnull_frame_chain_valid)
> (pc_in_call_dummy_before_text_end)
> (pc_in_call_dummy_after_text_end)
> (pc_in_call_dummy_at_entry_point, generic_pc_in_call_dummy):
> Prevent gcc from complaining about unused arguments.
FYI, I pruned it back a bit and applied the attatched. Now if someone
would just change gcc :-)
Andrew
Tue Feb 29 18:40:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
From 2000-02-23 Eli Zaretskii <eliz@is.elta.co.il>:
* utils.c [__GO32__]: Include pc.h, for prototypes of ScreenCols
and ScreenRows.
* ser-go32.c: Include string.h, for prototype of strncasecmp.
(dpmi_regs, dpmi_sregs): Remove unused variables.
(dos_flush_input): Return a value, to prevent compiler warning.
* expprint.c (dump_prefix_expression): Use %ld in format and cast
sizeof(union exp_element) to long, to prevent GCC from complaining
about format/argument mismatch.
(dump_postfix_expression): Likewise.
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.1.1.6
diff -p -r1.1.1.6 expprint.c
*** expprint.c 2000/02/02 00:21:06 1.1.1.6
--- expprint.c 2000/02/29 07:39:25
*************** dump_prefix_expression (exp, stream, not
*** 710,718 ****
print_expression (exp, stream);
else
fprintf_filtered (stream, "Type printing not yet supported....");
! fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %d bytes each.\n",
exp->language_defn->la_name, exp->nelts,
! sizeof (union exp_element));
fprintf_filtered (stream, "\t%5s %20s %16s %s\n", "Index", "Opcode",
"Hex Value", "String Value");
for (elt = 0; elt < exp->nelts; elt++)
--- 710,718 ----
print_expression (exp, stream);
else
fprintf_filtered (stream, "Type printing not yet supported....");
! fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
exp->language_defn->la_name, exp->nelts,
! (long) sizeof (union exp_element));
fprintf_filtered (stream, "\t%5s %20s %16s %s\n", "Index", "Opcode",
"Hex Value", "String Value");
for (elt = 0; elt < exp->nelts; elt++)
*************** dump_postfix_expression (exp, stream, no
*** 986,994 ****
print_expression (exp, stream);
else
fputs_filtered ("Type printing not yet supported....", stream);
! fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %d bytes each.\n",
exp->language_defn->la_name, exp->nelts,
! sizeof (union exp_element));
fputs_filtered ("\n", stream);
for (elt = 0; elt < exp->nelts;)
--- 986,994 ----
print_expression (exp, stream);
else
fputs_filtered ("Type printing not yet supported....", stream);
! fprintf_filtered (stream, "'\n\tLanguage %s, %d elements, %ld bytes each.\n",
exp->language_defn->la_name, exp->nelts,
! (long) sizeof (union exp_element));
fputs_filtered ("\n", stream);
for (elt = 0; elt < exp->nelts;)
Index: ser-go32.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-go32.c,v
retrieving revision 1.1.1.5
diff -p -r1.1.1.5 ser-go32.c
*** ser-go32.c 2000/02/02 00:21:10 1.1.1.5
--- ser-go32.c 2000/02/29 07:39:27
***************
*** 127,141 ****
#define MSR_DDSR 0x02
#define MSR_DCTS 0x01
#include <dos.h>
#include <go32.h>
#include <dpmi.h>
typedef unsigned long u_long;
- /* DPMI Communication */
- static union REGS dpmi_regs;
- static struct SREGS dpmi_sregs;
-
/* 16550 rx fifo trigger point */
#define FIFO_TRIGGER FIFO_TRIGGER_4
--- 127,138 ----
#define MSR_DDSR 0x02
#define MSR_DCTS 0x01
+ #include <string.h>
#include <dos.h>
#include <go32.h>
#include <dpmi.h>
typedef unsigned long u_long;
/* 16550 rx fifo trigger point */
#define FIFO_TRIGGER FIFO_TRIGGER_4
*************** dos_flush_input (scb)
*** 693,698 ****
--- 690,696 ----
if (port->fifo)
outb (port, com_fifo, FIFO_ENABLE | FIFO_RCV_RST | FIFO_TRIGGER);
enable ();
+ return 0;
}
static void
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.1.1.26
diff -p -r1.1.1.26 utils.c
*** utils.c 2000/02/02 00:21:11 1.1.1.26
--- utils.c 2000/02/29 07:39:34
***************
*** 31,36 ****
--- 31,40 ----
#include <term.h>
#endif
+ #ifdef __GO32__
+ #include <pc.h>
+ #endif
+
/* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */
#ifdef reg
#undef reg