compile: Fix uninitialized variable compiler warnings
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 16 May 2015 14:36:44 +0000 (16:36 +0200)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 16 May 2015 14:37:47 +0000 (16:37 +0200)
gdb/ChangeLog
2015-05-16  Jan Kratochvil  <jan.kratochvil@redhat.com>

* compile/compile-object-load.c (get_out_value_type): Fix uninitialized
variable compiler warnings.

gdb/ChangeLog
gdb/compile/compile-object-load.c

index e5de8347852fd2f1a9b23164aed6846fd7bc2b35..500eae17f7db5302d202e212b343d88d83afa4bd 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * compile/compile-object-load.c (get_out_value_type): Fix uninitialized
+       variable compiler warnings.
+
 2015-05-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * compile/compile-object-load.c (get_out_value_type): Fix returned type.
index e2d8f2f1c708a15e896d127adc4cf5a0fd63b863..67bc69af7b733fe2b9d13ead2619b0c1ab99bf09 100644 (file)
@@ -371,9 +371,12 @@ static struct type *
 get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
                    enum compile_i_scope_types scope)
 {
-  struct symbol *gdb_ptr_type_sym, *gdb_val_sym;
+  struct symbol *gdb_ptr_type_sym;
+  /* Initialize it just to avoid a GCC false warning.  */
+  struct symbol *gdb_val_sym = NULL;
   struct type *gdb_ptr_type, *gdb_type_from_ptr, *gdb_type, *retval;
-  const struct block *block;
+  /* Initialize it just to avoid a GCC false warning.  */
+  const struct block *block = NULL;
   const struct blockvector *bv;
   int nblocks = 0;
   int block_loop = 0;
@@ -384,7 +387,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
   gdb_ptr_type_sym = NULL;
   for (block_loop = 0; block_loop < nblocks; block_loop++)
     {
-      struct symbol *function;
+      struct symbol *function = NULL;
       const struct block *function_block;
 
       block = BLOCKVECTOR_BLOCK (bv, block_loop);
This page took 0.028724 seconds and 4 git commands to generate.