From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3168 invoked by alias); 20 May 2011 05:13:14 -0000 Received: (qmail 3158 invoked by uid 22791); 20 May 2011 05:13:12 -0000 X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KAM_STOCKTIP,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_FC X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 May 2011 05:12:52 +0000 Received: by fxm18 with SMTP id 18so3069909fxm.0 for ; Thu, 19 May 2011 22:12:51 -0700 (PDT) Received: by 10.223.53.85 with SMTP id l21mr857648fag.26.1305868371099; Thu, 19 May 2011 22:12:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.114.12 with HTTP; Thu, 19 May 2011 22:12:11 -0700 (PDT) In-Reply-To: <201105191059.02173.pedro@codesourcery.com> References: <201105191059.02173.pedro@codesourcery.com> From: Hui Zhu Date: Fri, 20 May 2011 05:13:00 -0000 Message-ID: Subject: Re: [OB] Fix xcoffread.c build error To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00468.txt.bz2 On Thu, May 19, 2011 at 17:59, Pedro Alves wrote: > On Thursday 19 May 2011 07:56:00, Hui Zhu wrote: >> gcc -g -O2 =A0 -I. -I../../src/gdb -I../../src/gdb/common >> -I../../src/gdb/config -DLOCALEDIR=3D"\"/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 =A0-I../../src/gdb/gnulib -Ignulib >> -DMI_OUT=3D1 -DTUI=3D1 -DGDBTK =A0-Wall -Wdeclaration-after-statement >> -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused >> -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts >> -Werror -c -o xcoffread.o -MT xcoffread.o -MMD -MP -MF >> .deps/xcoffread.Tpo ../../src/gdb/xcoffread.c >> cc1: warnings being treated as errors >> ../../src/gdb/xcoffread.c: In function 'xcoff_psymtab_to_symtab_1': >> ../../src/gdb/xcoffread.c:964:25: error: >> 'fcn_aux_saved$x_sym$x_misc$x_fsize' may be used uninitialized in this >> function >> make[2]: *** [xcoffread.o] Error 1 >> make[2]: Leaving directory `/home/teawater/gdb/cvs/ba/gdb' >> make[1]: *** [all-gdb] Error 2 >> make[1]: Leaving directory `/home/teawater/gdb/cvs/ba' >> make: *** [all] Error 2 >> >> 2011-05-19 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 * xcoffread.c (read_xcoff_symtab): Initialize fcn_aux_saved. >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> RCS file: /cvs/src/src/gdb/xcoffread.c,v >> retrieving revision 1.87 >> retrieving revision 1.88 >> diff -u -r1.87 -r1.88 >> --- src/gdb/xcoffread.c =A0 =A0 =A0 2011/04/19 14:33:09 =A0 =A0 1.87 >> +++ src/gdb/xcoffread.c =A0 =A0 =A0 2011/05/19 06:54:30 =A0 =A0 1.88 >> @@ -961,7 +961,7 @@ >> =A0 =A0struct coff_symbol fcn_stab_saved =3D { 0 }; >> >> =A0 =A0/* fcn_cs_saved is global because process_xcoff_symbol needs it. = =A0*/ >> - =A0union internal_auxent fcn_aux_saved; >> + =A0union internal_auxent fcn_aux_saved =3D main_aux; > > Hmm? =A0Initializing fcn_aux_saved with the also uninitialized > main_aux makes the warning go away? > > This appears to be hiding a real bug. > >> =A0 =A0struct context_stack *new; >> >> =A0 =A0char *filestring =3D " _start_ "; =A0 =A0/* Name of the current f= ile. =A0*/ >> > > -- > Pedro Alves > I am sorry that I just make it can be build but looks didn't fix it. I checked all of this function: while (symnum < max_symnum) { if ((cs->c_sclass =3D=3D C_EXT || cs->c_sclass =3D=3D C_HIDEXT) && cs->c_naux =3D=3D 1) { bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass, 0, cs->c_naux, &main_aux); case XTY_LD: case XMC_PR: fcn_aux_saved =3D main_aux; case C_FCN: else if (strcmp (cs->c_name, ".ef") =3D=3D 0) finish_block (new->name, &local_symbols, new->old_blocks, new->start_addr, (fcn_cs_saved.c_value + fcn_aux_saved.x_sym.x_misc.x_fsize + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))), objfile); Not sure I can fixed it or not. What about add a "fcn_aux_saved =3D main_aux;" after "bfd_coff_swap_aux_in"? Thanks, Hui