[patch/mi] Zap -Wuninitialized warnings

Andrew Cagney ac131313@cygnus.com
Tue Mar 20 09:19:00 GMT 2001


FYI,

I've checked in the attatched.

	Andrew
2001-03-20  Andrew Cagney  <ac131313@redhat.com>

	* mi-cmd-disas.c (mi_cmd_disassemble): Initialize ``file_string''
	and ``line_num''.  Consolidate declaration of argument variables.

Index: mi-cmd-disas.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-cmd-disas.c,v
retrieving revision 1.8
diff -p -r1.8 mi-cmd-disas.c
*** mi-cmd-disas.c	2001/03/06 08:21:45	1.8
--- mi-cmd-disas.c	2001/03/20 17:17:48
*************** mi_cmd_disassemble (char *command, char 
*** 112,126 ****
  {
    CORE_ADDR pc;
    CORE_ADDR start;
-   CORE_ADDR low = 0;
-   CORE_ADDR high = 0;
  
-   int how_many = -1;
    int mixed_source_and_assembly;
    int num_displayed;
-   int line_num;
- 
-   char *file_string;
    static disassemble_info di;
    static int di_initialized;
  
--- 112,120 ----
*************** mi_cmd_disassemble (char *command, char 
*** 136,147 ****
    char *filename = NULL;
    char *name = NULL;
  
!   /* Which options have we processed? */
    int file_seen = 0;
    int line_seen = 0;
    int num_seen = 0;
    int start_seen = 0;
    int end_seen = 0;
  
    /* Options processing stuff. */
    int optind = 0;
--- 130,148 ----
    char *filename = NULL;
    char *name = NULL;
  
!   /* Which options have we processed ... */
    int file_seen = 0;
    int line_seen = 0;
    int num_seen = 0;
    int start_seen = 0;
    int end_seen = 0;
+ 
+   /* ... and their corresponding value. */
+   char *file_string = NULL;
+   int line_num = -1;
+   int how_many = -1;
+   CORE_ADDR low = 0;
+   CORE_ADDR high = 0;
  
    /* Options processing stuff. */
    int optind = 0;


More information about the Gdb-patches mailing list