blarsen / rpms / gdb

Forked from rpms/gdb 2 years ago
Clone
aefb0e1
Index: gdb-6.6/gdb/mi/mi-cmd-env.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/mi/mi-cmd-env.c
aefb0e1
+++ gdb-6.6/gdb/mi/mi-cmd-env.c
8898d54
@@ -126,7 +126,7 @@ mi_cmd_env_path (char *command, char **a
8898d54
   static struct mi_opt opts[] =
8898d54
   {
8898d54
     {"r", RESET_OPT, 0},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   dont_repeat ();
8898d54
@@ -198,7 +198,7 @@ mi_cmd_env_dir (char *command, char **ar
8898d54
   static struct mi_opt opts[] =
8898d54
   {
8898d54
     {"r", RESET_OPT, 0},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   dont_repeat ();
aefb0e1
Index: gdb-6.6/gdb/mi/mi-getopt.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/mi/mi-getopt.c
aefb0e1
+++ gdb-6.6/gdb/mi/mi-getopt.c
8898d54
@@ -82,7 +82,7 @@ mi_valid_noargs (const char *prefix, int
8898d54
   char *optarg;
8898d54
   static struct mi_opt opts[] =
8898d54
   {
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) == -1)
aefb0e1
Index: gdb-6.6/gdb/mi/mi-cmd-break.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/mi/mi-cmd-break.c
aefb0e1
+++ gdb-6.6/gdb/mi/mi-cmd-break.c
8898d54
@@ -90,7 +90,7 @@ mi_cmd_break_insert (char *command, char
8898d54
     {"c", CONDITION_OPT, 1},
8898d54
     {"i", IGNORE_COUNT_OPT, 1},
8898d54
     {"p", THREAD_OPT, 1},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   /* Parse arguments. It could be -r or -h or -t, <location> or ``--''
9231e41
@@ -196,7 +196,7 @@ mi_cmd_break_watch (char *command, char 
8898d54
   {
8898d54
     {"r", READ_OPT, 0},
8898d54
     {"a", ACCESS_OPT, 0},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   /* Parse arguments. */
aefb0e1
Index: gdb-6.6/gdb/mi/mi-cmd-disas.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/mi/mi-cmd-disas.c
aefb0e1
+++ gdb-6.6/gdb/mi/mi-cmd-disas.c
8898d54
@@ -84,7 +84,7 @@ mi_cmd_disassemble (char *command, char 
8898d54
     {"n", NUM_OPT, 1},
8898d54
     {"s", START_OPT, 1},
8898d54
     {"e", END_OPT, 1},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   /* Get the options with their arguments. Keep track of what we
aefb0e1
Index: gdb-6.6/gdb/mi/mi-main.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/mi/mi-main.c
aefb0e1
+++ gdb-6.6/gdb/mi/mi-main.c
9231e41
@@ -773,7 +773,7 @@ mi_cmd_data_read_memory (char *command, 
8898d54
   static struct mi_opt opts[] =
8898d54
   {
8898d54
     {"o", OFFSET_OPT, 1},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   while (1)
aefb0e1
@@ -973,7 +973,7 @@ mi_cmd_data_write_memory (char *command,
8898d54
   static struct mi_opt opts[] =
8898d54
   {
8898d54
     {"o", OFFSET_OPT, 1},
8898d54
-    0
8898d54
+    {0}
8898d54
   };
8898d54
 
8898d54
   while (1)
aefb0e1
Index: gdb-6.6/gdb/p-valprint.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/p-valprint.c
aefb0e1
+++ gdb-6.6/gdb/p-valprint.c
9231e41
@@ -753,7 +753,7 @@ pascal_object_print_value_fields (struct
8898d54
 				  int dont_print_statmem)
8898d54
 {
8898d54
   int i, len, n_baseclasses;
8898d54
-  struct obstack tmp_obstack;
8898d54
+  struct obstack tmp_obstack = {0};
8898d54
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
8898d54
 
8898d54
   CHECK_TYPEDEF (type);
9231e41
@@ -922,7 +922,7 @@ pascal_object_print_value (struct type *
8898d54
 			   enum val_prettyprint pretty,
8898d54
 			   struct type **dont_print_vb)
8898d54
 {
8898d54
-  struct obstack tmp_obstack;
8898d54
+  struct obstack tmp_obstack = {0};
8898d54
   struct type **last_dont_print
8898d54
   = (struct type **) obstack_next_free (&dont_print_vb_obstack);
8898d54
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
aefb0e1
Index: gdb-6.6/gdb/cp-valprint.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/cp-valprint.c
aefb0e1
+++ gdb-6.6/gdb/cp-valprint.c
9231e41
@@ -265,7 +265,7 @@ cp_print_value_fields (struct type *type
9231e41
 		       struct type **dont_print_vb,int dont_print_statmem)
8898d54
 {
8898d54
   int i, len, n_baseclasses;
8898d54
-  struct obstack tmp_obstack;
8898d54
+  struct obstack tmp_obstack = {0};
8898d54
   char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
8898d54
   int fields_seen = 0;
8898d54
 
9231e41
@@ -524,7 +524,7 @@ cp_print_value (struct type *type, struc
9231e41
 		struct ui_file *stream, int format, int recurse,
9231e41
 		enum val_prettyprint pretty, struct type **dont_print_vb)
8898d54
 {
8898d54
-  struct obstack tmp_obstack;
8898d54
+  struct obstack tmp_obstack = {0};
8898d54
   struct type **last_dont_print
8898d54
     = (struct type **) obstack_next_free (&dont_print_vb_obstack);
8898d54
   int i, n_baseclasses = TYPE_N_BASECLASSES (type);
aefb0e1
Index: gdb-6.6/gdb/tui/tui-layout.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/tui/tui-layout.c
aefb0e1
+++ gdb-6.6/gdb/tui/tui-layout.c
8898d54
@@ -755,7 +755,7 @@ show_source_disasm_command (void)
8898d54
 	  if (TUI_DISASM_WIN == NULL)
8898d54
 	    {
8898d54
 	      make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
8898d54
-	      init_and_make_win ((void **) & locator,
8898d54
+	      init_and_make_win ((void **)(char *) & locator,
8898d54
 			       LOCATOR_WIN,
8898d54
 			       2 /* 1 */ ,
8898d54
 			       tui_term_width (),
8898d54
@@ -848,7 +848,7 @@ show_data (enum tui_layout_type new_layo
8898d54
 	make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
8898d54
       else
8898d54
 	make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
8898d54
-      init_and_make_win ((void **) & locator,
8898d54
+      init_and_make_win ((void **)(char *) & locator,
8898d54
 		       LOCATOR_WIN,
8898d54
 		       2 /* 1 */ ,
8898d54
 		       tui_term_width (),
8898d54
@@ -963,7 +963,7 @@ make_source_or_disasm_window (struct tui
8898d54
     execution_info = tui_source_exec_info_win_ptr ();
8898d54
   else
8898d54
     execution_info = tui_disassem_exec_info_win_ptr ();
8898d54
-  init_and_make_win ((void **) & execution_info,
8898d54
+  init_and_make_win ((void **)(char *) & execution_info,
8898d54
 		   EXEC_INFO_WIN,
8898d54
 		   height,
8898d54
 		   3,
8898d54
@@ -1013,7 +1013,7 @@ show_source_or_disasm_and_command (enum 
8898d54
 	    make_source_window (win_info_ptr, src_height - 1, 0);
8898d54
 	  else
8898d54
 	    make_disasm_window (win_info_ptr, src_height - 1, 0);
8898d54
-	  init_and_make_win ((void **) & locator,
8898d54
+	  init_and_make_win ((void **)(char *) & locator,
8898d54
 			   LOCATOR_WIN,
8898d54
 			   2 /* 1 */ ,
8898d54
 			   tui_term_width (),
aefb0e1
Index: gdb-6.6/gdb/testsuite/gdb.base/move-dir.h
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/testsuite/gdb.base/move-dir.h
aefb0e1
+++ gdb-6.6/gdb/testsuite/gdb.base/move-dir.h
8898d54
@@ -1,4 +1,4 @@
8898d54
-#include <stdlib.h>
8898d54
+#include <stdio.h>
8898d54
 
8898d54
 void other() {
8898d54
   const char* ostring = "other";
aefb0e1
Index: gdb-6.6/gdb/testsuite/gdb.base/sigrepeat.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/testsuite/gdb.base/sigrepeat.c
aefb0e1
+++ gdb-6.6/gdb/testsuite/gdb.base/sigrepeat.c
9231e41
@@ -22,6 +22,7 @@
9231e41
 #include <stdlib.h>
8898d54
 #include <string.h>
8898d54
 #include <signal.h>
8898d54
+#include <stdlib.h>
8898d54
 #include <sys/time.h>
8898d54
 
9231e41
 static volatile int done[2];
aefb0e1
Index: gdb-6.6/gdb/s390-tdep.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/s390-tdep.c
aefb0e1
+++ gdb-6.6/gdb/s390-tdep.c
21721b8
@@ -2277,6 +2277,9 @@ s390_return_value (struct gdbarch *gdbar
21721b8
 	case RETURN_VALUE_STRUCT_CONVENTION:
21721b8
 	  error (_("Cannot set function return value."));
21721b8
 	  break;
21721b8
+
21721b8
+        default:
21721b8
+      	  break;
21721b8
 	}
21721b8
     }
21721b8
   else if (out)
21721b8
@@ -2309,6 +2312,9 @@ s390_return_value (struct gdbarch *gdbar
8898d54
 	case RETURN_VALUE_STRUCT_CONVENTION:
9231e41
 	  error (_("Function return value unknown."));
8898d54
 	  break;
8898d54
+
8898d54
+        default:
8898d54
+      	  break;
8898d54
 	}
8898d54
     }
8898d54
 
aefb0e1
Index: gdb-6.6/gdb/remote.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/remote.c
aefb0e1
+++ gdb-6.6/gdb/remote.c
aefb0e1
@@ -2843,10 +2843,10 @@ cleanup_sigint_signal_handler (void *dum
8898d54
 {
8898d54
   signal (SIGINT, handle_sigint);
8898d54
   if (sigint_remote_twice_token)
aefb0e1
-    delete_async_signal_handler ((struct async_signal_handler **)
9231e41
+    delete_async_signal_handler ((struct async_signal_handler **) (char *)
9231e41
 				 &sigint_remote_twice_token);
8898d54
   if (sigint_remote_token)
aefb0e1
-    delete_async_signal_handler ((struct async_signal_handler **)
9231e41
+    delete_async_signal_handler ((struct async_signal_handler **) (char *)
9231e41
 				 &sigint_remote_token);
8898d54
 }
8898d54
 
aefb0e1
Index: gdb-6.6/gdb/f-exp.y
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/f-exp.y
aefb0e1
+++ gdb-6.6/gdb/f-exp.y
9231e41
@@ -567,6 +567,8 @@ ptype	:	typebase
8898d54
 		      case tp_function:
8898d54
 			follow_type = lookup_function_type (follow_type);
8898d54
 			break;
8898d54
+		      default:
8898d54
+			break;
8898d54
 		      }
8898d54
 		  $$ = follow_type;
8898d54
 		}
aefb0e1
Index: gdb-6.6/gdb/remote-fileio.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/remote-fileio.c
aefb0e1
+++ gdb-6.6/gdb/remote-fileio.c
aefb0e1
@@ -1332,19 +1332,19 @@ static struct {
8898d54
   char *name;
8898d54
   void (*func)(char *);
8898d54
 } remote_fio_func_map[] = {
8898d54
-  "open", remote_fileio_func_open,
8898d54
-  "close", remote_fileio_func_close,
8898d54
-  "read", remote_fileio_func_read,
8898d54
-  "write", remote_fileio_func_write,
8898d54
-  "lseek", remote_fileio_func_lseek,
8898d54
-  "rename", remote_fileio_func_rename,
8898d54
-  "unlink", remote_fileio_func_unlink,
8898d54
-  "stat", remote_fileio_func_stat,
8898d54
-  "fstat", remote_fileio_func_fstat,
8898d54
-  "gettimeofday", remote_fileio_func_gettimeofday,
8898d54
-  "isatty", remote_fileio_func_isatty,
8898d54
-  "system", remote_fileio_func_system,
8898d54
-  NULL, NULL
8898d54
+	{"open", remote_fileio_func_open},
8898d54
+	{"close", remote_fileio_func_close},
8898d54
+	{"read", remote_fileio_func_read},
8898d54
+	{"write", remote_fileio_func_write},
8898d54
+	{"lseek", remote_fileio_func_lseek},
8898d54
+	{"rename", remote_fileio_func_rename},
8898d54
+	{"unlink", remote_fileio_func_unlink},
8898d54
+	{"stat", remote_fileio_func_stat},
8898d54
+	{"fstat", remote_fileio_func_fstat},
8898d54
+	{"gettimeofday", remote_fileio_func_gettimeofday},
8898d54
+	{"isatty", remote_fileio_func_isatty},
8898d54
+	{"system", remote_fileio_func_system},
8898d54
+	{NULL, NULL}
8898d54
 };
8898d54
 
8898d54
 static int
aefb0e1
Index: gdb-6.6/gdb/source.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/source.c
aefb0e1
+++ gdb-6.6/gdb/source.c
aefb0e1
@@ -172,7 +172,7 @@ get_current_source_symtab_and_line (void
9231e41
 void
9231e41
 set_default_source_symtab_and_line (void)
8898d54
 {
8898d54
-  struct symtab_and_line cursal;
8898d54
+  struct symtab_and_line cursal = {0};
8898d54
 
9231e41
   if (!have_full_symbols () && !have_partial_symbols ())
9231e41
     error (_("No symbol table is loaded.  Use the \"file\" command."));
aefb0e1
@@ -1428,7 +1428,7 @@ static void
8898d54
 line_info (char *arg, int from_tty)
8898d54
 {
8898d54
   struct symtabs_and_lines sals;
8898d54
-  struct symtab_and_line sal;
8898d54
+  struct symtab_and_line sal = {0};
8898d54
   CORE_ADDR start_pc, end_pc;
8898d54
   int i;
8898d54
 
aefb0e1
Index: gdb-6.6/gdb/symfile.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/symfile.c
aefb0e1
+++ gdb-6.6/gdb/symfile.c
aefb0e1
@@ -2933,6 +2933,8 @@ add_psymbol_with_dem_name_to_list (char 
8898d54
 	deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
8898d54
       break;
8898d54
       /* FIXME What should be done for the default case? Ignoring for now. */
8898d54
+    default:
8898d54
+      break;
8898d54
     }
8898d54
 
8898d54
   /* val and coreaddr are mutually exclusive, one of them *will* be zero */
aefb0e1
Index: gdb-6.6/gdb/linespec.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/linespec.c
aefb0e1
+++ gdb-6.6/gdb/linespec.c
9231e41
@@ -1631,7 +1631,7 @@ static struct symtabs_and_lines
8898d54
 find_method (int funfirstline, char ***canonical, char *saved_arg,
8898d54
 	     char *copy, struct type *t, struct symbol *sym_class)
8898d54
 {
8898d54
-  struct symtabs_and_lines values;
8898d54
+  struct symtabs_and_lines values = {0};
8898d54
   struct symbol *sym = 0;
8898d54
   int i1;	/*  Counter for the symbol array.  */
8898d54
   struct symbol **sym_arr =  alloca (total_number_of_methods (t)
aefb0e1
Index: gdb-6.6/gdb/macroscope.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/macroscope.c
aefb0e1
+++ gdb-6.6/gdb/macroscope.c
8898d54
@@ -33,7 +33,7 @@
8898d54
 struct macro_scope *
8898d54
 sal_macro_scope (struct symtab_and_line sal)
8898d54
 {
8898d54
-  struct macro_source_file *main, *inclusion;
8898d54
+  struct macro_source_file *main_sf, *inclusion;
8898d54
   struct macro_scope *ms;
8898d54
 
8898d54
   if (! sal.symtab
8898d54
@@ -42,8 +42,8 @@ sal_macro_scope (struct symtab_and_line 
8898d54
 
8898d54
   ms = (struct macro_scope *) xmalloc (sizeof (*ms));
8898d54
 
8898d54
-  main = macro_main (sal.symtab->macro_table);
8898d54
-  inclusion = macro_lookup_inclusion (main, sal.symtab->filename);
8898d54
+  main_sf = macro_main (sal.symtab->macro_table);
8898d54
+  inclusion = macro_lookup_inclusion (main_sf, sal.symtab->filename);
8898d54
 
8898d54
   if (inclusion)
8898d54
     {
8898d54
@@ -66,7 +66,7 @@ sal_macro_scope (struct symtab_and_line 
8898d54
 
8898d54
          For the time being, though, we'll just treat these as
8898d54
          occurring at the end of the main source file.  */
8898d54
-      ms->file = main;
8898d54
+      ms->file = main_sf;
8898d54
       ms->line = -1;
8898d54
 
8898d54
       complaint (&symfile_complaints,
8898d54
@@ -83,7 +83,6 @@ struct macro_scope *
8898d54
 default_macro_scope (void)
8898d54
 {
8898d54
   struct symtab_and_line sal;
8898d54
-  struct macro_source_file *main;
8898d54
   struct macro_scope *ms;
8898d54
 
8898d54
   /* If there's a selected frame, use its PC.  */ 
aefb0e1
Index: gdb-6.6/gdb/target.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/target.c
aefb0e1
+++ gdb-6.6/gdb/target.c
aefb0e1
@@ -1045,6 +1045,9 @@ memory_xfer_partial (struct target_ops *
aefb0e1
       if (writebuf != NULL)
aefb0e1
 	error (_("Writing to flash memory forbidden in this context"));
8898d54
       break;
8898d54
+
8898d54
+    default:
8898d54
+      break;
8898d54
     }
8898d54
 
8898d54
   if (region->attrib.cache)
aefb0e1
Index: gdb-6.6/gdb/gdb-events.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/gdb-events.c
aefb0e1
+++ gdb-6.6/gdb/gdb-events.c
9231e41
@@ -321,6 +321,8 @@ gdb_events_deliver (struct gdb_events *v
8898d54
 	case architecture_changed:
8898d54
 	  vector->architecture_changed ();
8898d54
 	  break;
8898d54
+	default:
8898d54
+	  break;
8898d54
 	}
8898d54
       delivering_events = event->next;
8898d54
       xfree (event);
aefb0e1
Index: gdb-6.6/gdb/dwarf2read.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/dwarf2read.c
aefb0e1
+++ gdb-6.6/gdb/dwarf2read.c
aefb0e1
@@ -9307,6 +9307,7 @@ dwarf_decode_macros (struct line_header 
8898d54
   for (;;)
8898d54
     {
8898d54
       enum dwarf_macinfo_record_type macinfo_type;
8898d54
+      int tmp;
8898d54
 
8898d54
       /* Do we at least have room for a macinfo type byte?  */
8898d54
       if (mac_ptr >= mac_end)
aefb0e1
@@ -9318,13 +9319,16 @@ dwarf_decode_macros (struct line_header 
8898d54
       macinfo_type = read_1_byte (abfd, mac_ptr);
8898d54
       mac_ptr++;
8898d54
 
8898d54
+      /* Check for a zero macinfo type which indicates the end of the macro
8898d54
+         information.  We do this as the compiler may warn us if we
8898d54
+         try and look for 0 in the switch below because 0 is not
8898d54
+         an enumerated value.  */
8898d54
+      tmp = (int)macinfo_type;
8898d54
+      if (tmp == 0)
8898d54
+	return;
9231e41
+
8898d54
       switch (macinfo_type)
8898d54
         {
8898d54
-          /* A zero macinfo type indicates the end of the macro
8898d54
-             information.  */
8898d54
-        case 0:
8898d54
-          return;
8898d54
-
8898d54
         case DW_MACINFO_define:
8898d54
         case DW_MACINFO_undef:
8898d54
           {
aefb0e1
Index: gdb-6.6/gdb/stabsread.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/stabsread.c
aefb0e1
+++ gdb-6.6/gdb/stabsread.c
8898d54
@@ -1794,7 +1794,8 @@ again:
8898d54
 	  struct type *domain = read_type (pp, objfile);
8898d54
 	  struct type *return_type;
8898d54
 	  struct field *args;
8898d54
-	  int nargs, varargs;
8898d54
+	  int nargs = 0;
8898d54
+	  int varargs = 0;
8898d54
 
8898d54
 	  if (**pp != ',')
8898d54
 	    /* Invalid member type data format.  */
aefb0e1
Index: gdb-6.6/gdb/dwarf2expr.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/dwarf2expr.c
aefb0e1
+++ gdb-6.6/gdb/dwarf2expr.c
9231e41
@@ -559,6 +559,8 @@ execute_stack_op (struct dwarf_expr_cont
8898d54
 	      op_ptr = read_uleb128 (op_ptr, op_end, ®);
8898d54
 	      result += reg;
8898d54
 	      break;
8898d54
+	    default:
8898d54
+	      break;
8898d54
 	    }
8898d54
 	  break;
8898d54
 
aefb0e1
Index: gdb-6.6/gdb/varobj.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/varobj.c
aefb0e1
+++ gdb-6.6/gdb/varobj.c
9231e41
@@ -325,10 +325,9 @@ struct language_specific
8898d54
 
8898d54
 /* Array of known source language routines. */
8898d54
 static struct language_specific
8898d54
-  languages[vlang_end][sizeof (struct language_specific)] = {
8898d54
+  languages[vlang_end] = {
8898d54
   /* Unknown (try treating as C */
8898d54
-  {
8898d54
-   vlang_unknown,
8898d54
+  {vlang_unknown,
8898d54
    c_number_of_children,
8898d54
    c_name_of_variable,
8898d54
    c_name_of_child,
9231e41
@@ -339,8 +338,7 @@ static struct language_specific
8898d54
    c_value_of_variable}
8898d54
   ,
8898d54
   /* C */
8898d54
-  {
8898d54
-   vlang_c,
8898d54
+  {vlang_c,
8898d54
    c_number_of_children,
8898d54
    c_name_of_variable,
8898d54
    c_name_of_child,
9231e41
@@ -351,8 +349,7 @@ static struct language_specific
8898d54
    c_value_of_variable}
8898d54
   ,
8898d54
   /* C++ */
8898d54
-  {
8898d54
-   vlang_cplus,
8898d54
+  {vlang_cplus,
8898d54
    cplus_number_of_children,
8898d54
    cplus_name_of_variable,
8898d54
    cplus_name_of_child,
9231e41
@@ -363,8 +360,7 @@ static struct language_specific
8898d54
    cplus_value_of_variable}
8898d54
   ,
8898d54
   /* Java */
8898d54
-  {
8898d54
-   vlang_java,
8898d54
+  {vlang_java,
8898d54
    java_number_of_children,
8898d54
    java_name_of_variable,
8898d54
    java_name_of_child,
9231e41
@@ -519,7 +515,7 @@ varobj_create (char *objname,
8898d54
 
8898d54
       /* Set language info */
8898d54
       lang = variable_language (var);
8898d54
-      var->root->lang = languages[lang];
8898d54
+      var->root->lang = &languages[lang];
8898d54
 
8898d54
       /* Set ourselves as our root */
8898d54
       var->root->rootvar = var;
aefb0e1
Index: gdb-6.6/gdb/doublest.c
9231e41
===================================================================
aefb0e1
--- gdb-6.6.orig/gdb/doublest.c
aefb0e1
+++ gdb-6.6/gdb/doublest.c
9231e41
@@ -94,15 +94,10 @@ get_field (const bfd_byte *data, enum fl
9231e41
     {
9231e41
       result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
9231e41
       cur_bitshift += FLOATFORMAT_CHAR_BIT;
9231e41
-      switch (order)
9231e41
-	{
9231e41
-	case floatformat_little:
9231e41
-	  ++cur_byte;
9231e41
-	  break;
9231e41
-	case floatformat_big:
9231e41
-	  --cur_byte;
9231e41
-	  break;
9231e41
-	}
9231e41
+      if (order == floatformat_little)
9231e41
+	++cur_byte;
9231e41
+      else
9231e41
+	--cur_byte;
9231e41
     }
9231e41
   if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
9231e41
     /* Mask out bits which are not part of the field */
8336d58
diff -u -rup gdb-6.6-orig/gdb/cli/cli-cmds.c gdb-6.6/gdb/cli/cli-cmds.c
8336d58
--- gdb-6.6-orig/gdb/cli/cli-cmds.c	2007-04-08 20:49:09.000000000 +0200
8336d58
+++ gdb-6.6/gdb/cli/cli-cmds.c	2007-04-08 20:54:49.000000000 +0200
8336d58
@@ -323,7 +323,8 @@ pwd_command (char *args, int from_tty)
8336d58
 {
8336d58
   if (args)
8336d58
     error (_("The \"pwd\" command does not take an argument: %s"), args);
8336d58
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
+  /* Unused result.  */
8336d58
+  1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
 
8336d58
   if (strcmp (gdb_dirbuf, current_directory) != 0)
8336d58
     printf_unfiltered (_("Working directory %s\n (canonically %s).\n"),
8336d58
diff -u -rup gdb-6.6-orig/gdb/inflow.c gdb-6.6/gdb/inflow.c
8336d58
--- gdb-6.6-orig/gdb/inflow.c	2006-02-10 23:01:43.000000000 +0100
8336d58
+++ gdb-6.6/gdb/inflow.c	2007-04-08 20:56:48.000000000 +0200
8336d58
@@ -549,17 +549,20 @@ new_tty (void)
8336d58
   if (tty != 0)
8336d58
     {
8336d58
       close (0);
8336d58
-      dup (tty);
8336d58
+      /* Unused result.  */
8336d58
+      1 && dup (tty);
8336d58
     }
8336d58
   if (tty != 1)
8336d58
     {
8336d58
       close (1);
8336d58
-      dup (tty);
8336d58
+      /* Unused result.  */
8336d58
+      1 && dup (tty);
8336d58
     }
8336d58
   if (tty != 2)
8336d58
     {
8336d58
       close (2);
8336d58
-      dup (tty);
8336d58
+      /* Unused result.  */
8336d58
+      1 && dup (tty);
8336d58
     }
8336d58
   if (tty > 2)
8336d58
     close (tty);
8336d58
diff -u -rup gdb-6.6-orig/gdb/linux-nat.c gdb-6.6/gdb/linux-nat.c
8336d58
--- gdb-6.6-orig/gdb/linux-nat.c	2007-04-08 20:49:11.000000000 +0200
8336d58
+++ gdb-6.6/gdb/linux-nat.c	2007-04-08 20:54:08.000000000 +0200
8336d58
@@ -2972,7 +2972,8 @@ linux_nat_info_proc_cmd (char *args, int
8336d58
       sprintf (fname1, "/proc/%lld/cmdline", pid);
8336d58
       if ((procfile = fopen (fname1, "r")) > 0)
8336d58
 	{
8336d58
-	  fgets (buffer, sizeof (buffer), procfile);
8336d58
+	  /* Unused result.  */
8336d58
+	  1 && fgets (buffer, sizeof (buffer), procfile);
8336d58
 	  printf_filtered ("cmdline = '%s'\n", buffer);
8336d58
 	  fclose (procfile);
8336d58
 	}
8336d58
diff -u -rup gdb-6.6-orig/gdb/main.c gdb-6.6/gdb/main.c
8336d58
--- gdb-6.6-orig/gdb/main.c	2007-04-08 20:49:09.000000000 +0200
8336d58
+++ gdb-6.6/gdb/main.c	2007-04-08 20:55:30.000000000 +0200
8336d58
@@ -195,7 +195,8 @@ captured_main (void *data)
8336d58
   line[0] = '\0';		/* Terminate saved (now empty) cmd line */
8336d58
   instream = stdin;
8336d58
 
8336d58
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
+  /* Unused result.  */
8336d58
+  1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
   current_directory = gdb_dirbuf;
8336d58
 
8336d58
   gdb_stdout = stdio_fileopen (stdout);
8336d58
diff -u -rup gdb-6.6-orig/gdb/mi/mi-cmd-env.c gdb-6.6/gdb/mi/mi-cmd-env.c
8336d58
--- gdb-6.6-orig/gdb/mi/mi-cmd-env.c	2007-04-08 20:49:09.000000000 +0200
8336d58
+++ gdb-6.6/gdb/mi/mi-cmd-env.c	2007-04-08 20:55:11.000000000 +0200
8336d58
@@ -80,7 +80,8 @@ mi_cmd_env_pwd (char *command, char **ar
8336d58
      
8336d58
   /* Otherwise the mi level is 2 or higher.  */
8336d58
 
8336d58
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
+  /* Unused result.  */
8336d58
+  1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
   ui_out_field_string (uiout, "cwd", gdb_dirbuf);
8336d58
 
8336d58
   return MI_CMD_DONE;
8336d58
diff -u -rup gdb-6.6-orig/gdb/top.c gdb-6.6/gdb/top.c
8336d58
--- gdb-6.6-orig/gdb/top.c	2007-04-08 20:49:10.000000000 +0200
8336d58
+++ gdb-6.6/gdb/top.c	2007-04-08 20:55:46.000000000 +0200
8336d58
@@ -1643,7 +1643,8 @@ gdb_init (char *argv0)
8336d58
 
8336d58
   /* Run the init function of each source file */
8336d58
 
8336d58
-  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
+  /* Unused result.  */
8336d58
+  1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
8336d58
   current_directory = gdb_dirbuf;
8336d58
 
8336d58
 #ifdef __MSDOS__
8336d58
diff -u -rup gdb-6.6-orig/gdb/ui-file.c gdb-6.6/gdb/ui-file.c
8336d58
--- gdb-6.6-orig/gdb/ui-file.c	2005-12-17 23:34:03.000000000 +0100
8336d58
+++ gdb-6.6/gdb/ui-file.c	2007-04-08 20:56:21.000000000 +0200
8336d58
@@ -482,7 +482,8 @@ stdio_file_write (struct ui_file *file, 
8336d58
   if (stdio->magic != &stdio_file_magic)
8336d58
     internal_error (__FILE__, __LINE__,
8336d58
 		    _("stdio_file_write: bad magic number"));
8336d58
-  fwrite (buf, length_buf, 1, stdio->file);
8336d58
+  /* Unused result.  */
8336d58
+  1 && fwrite (buf, length_buf, 1, stdio->file);
8336d58
 }
8336d58
 
8336d58
 static void
8336d58
diff -u -rup gdb-6.6-orig/gdb/utils.c gdb-6.6/gdb/utils.c
8336d58
--- gdb-6.6-orig/gdb/utils.c	2007-04-08 20:49:09.000000000 +0200
8336d58
+++ gdb-6.6/gdb/utils.c	2007-04-08 20:56:01.000000000 +0200
8336d58
@@ -718,7 +718,8 @@ internal_vproblem (struct internal_probl
8336d58
 	abort ();	/* NOTE: GDB has only three calls to abort().  */
8336d58
       default:
8336d58
 	dejavu = 3;
8336d58
-	write (STDERR_FILENO, msg, sizeof (msg));
8336d58
+	/* Unused result.  */
8336d58
+	1 && write (STDERR_FILENO, msg, sizeof (msg));
8336d58
 	exit (1);
8336d58
       }
8336d58
   }
daafa05
--- ./gdb/gdbserver/gdbreplay.c	29 Mar 2007 01:06:47 -0000	1.14
daafa05
+++ ./gdb/gdbserver/gdbreplay.c	8 Aug 2007 20:32:12 -0000
daafa05
@@ -358,7 +358,12 @@ expect (FILE *fp)
daafa05
 	{
daafa05
 	  break;
daafa05
 	}
daafa05
-      read (remote_desc, &fromgdb, 1);
daafa05
+      if (read (remote_desc, &fromgdb, 1) != 1)
daafa05
+        {
daafa05
+	  /* Error gets reported below.  */
daafa05
+	  fromlog = 0;
daafa05
+	  break;
daafa05
+	}
daafa05
     }
daafa05
   while (fromlog == fromgdb);
daafa05
   if (fromlog != EOL)
daafa05
@@ -385,7 +390,11 @@ play (FILE *fp)
daafa05
   while ((fromlog = logchar (fp)) != EOL)
daafa05
     {
daafa05
       ch = fromlog;
daafa05
-      write (remote_desc, &ch, 1);
daafa05
+      if (write (remote_desc, &ch, 1) != 1)
daafa05
+        {
daafa05
+	  sync_error (fp, "Sync error during write of gdb packet", ch, 0);
daafa05
+	  break;
daafa05
+	}
daafa05
     }
daafa05
 }
daafa05