This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug build/11860] New: dwarf2read.c failed to compile with gcc version 3.4.4 (gdb-weekly-CVS-7.2.50.20100727)


Building source from gdb-weekly-CVS-7.2.50.20100727.tar.bz2 .
With gcc version 3.4.4 dwarf2read.c fails to compile because -Werror turns the
following 2 ewarnings into errors:

$ gcc -g -O1   -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/..
-I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd
-I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber 
-I../../src/gdb/gnulib -Ignulib  -DMI_OUT=1 -DTUI=1  -Wall
-Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-unused
-Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Werror -c -o
dwarf2read.o -MT dwarf2read.o -MMD -MP -MF .deps/dwarf2read.Tpo
../../src/gdb/dwarf2read.c
../../src/gdb/dwarf2read.c: In function `dwarf2_read_index':
../../src/gdb/dwarf2read.c:1838: warning: 'types_list' might be used
uninitialized in this function
../../src/gdb/dwarf2read.c:1839: warning: 'types_list_elements' might be used
uninitialized in this function
$ 

With this simple patch it compiles:

*** dwarf2read.c~	Mon Jul 26 05:30:00 2010
--- dwarf2read.c	Fri Jul 30 09:19:05 2010
***************
*** 1835,1842 ****
    char *addr;
    struct mapped_index *map;
    offset_type *metadata;
!   const gdb_byte *cu_list, *types_list;
!   offset_type version, cu_list_elements, types_list_elements;
    int i;
  
    if (dwarf2_per_objfile->gdb_index.asection == NULL
--- 1835,1842 ----
    char *addr;
    struct mapped_index *map;
    offset_type *metadata;
!   const gdb_byte *cu_list, *types_list = NULL;
!   offset_type version, cu_list_elements, types_list_elements = 0;
    int i;
  
    if (dwarf2_per_objfile->gdb_index.asection == NULL

-- 
           Summary: dwarf2read.c failed to compile with gcc version 3.4.4
                    (gdb-weekly-CVS-7.2.50.20100727)
           Product: gdb
           Version: 7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: richard_sharman at mitel dot com
                CC: gdb-prs at sourceware dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i386-vxworks


http://sourceware.org/bugzilla/show_bug.cgi?id=11860

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]