Fix recent compiler warnings.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 21 Feb 2017 08:14:37 +0000 (09:14 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 21 Feb 2017 08:14:37 +0000 (09:14 +0100)
gcc-4.8.5-11.el7.x86_64

dwarf2read.c: In function ‘pc_bounds_kind dwarf2_get_pc_bounds(die_info*, CORE_ADDR*, CORE_ADDR*, dwarf2_cu*, partial_symtab*)’:
dwarf2read.c:12134:7: error: ‘range_end’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
dwarf2read.c:12133:7: error: ‘range_beginning’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

gdb/ChangeLog
2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

* dwarf2_rnglists_process: Initialize range_beginning and range_end.

gdb/ChangeLog
gdb/dwarf2read.c

index 051e257874f88cce1ca484b5d4690b9a1b78080e..2a703ae5c1641c22744a0feb1a46e6fd6f175e1f 100644 (file)
@@ -1,3 +1,7 @@
+2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * dwarf2_rnglists_process: Initialize range_beginning and range_end.
+
 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * NEWS (Changes since GDB 7.12): Add DWARF-5.
index ae7d3f2474f1f65ba60155724167ee52048b922a..8a6e1f3dced9021be64244b1c99c65b70005a7b0 100644 (file)
@@ -12030,7 +12030,8 @@ dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu,
 
   while (1)
     {
-      CORE_ADDR range_beginning, range_end;
+      /* Initialize it due to a false compiler warning.  */
+      CORE_ADDR range_beginning = 0, range_end = 0;
       const gdb_byte *buf_end = (dwarf2_per_objfile->rnglists.buffer
                                 + dwarf2_per_objfile->rnglists.size);
       unsigned int bytes_read;