From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12441 invoked by alias); 21 Apr 2010 08:45:10 -0000 Received: (qmail 12377 invoked by uid 22791); 21 Apr 2010 08:45:08 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Apr 2010 08:45:03 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3L8ixni039680 for ; Wed, 21 Apr 2010 10:45:00 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o3L8ixTS082123 for ; Wed, 21 Apr 2010 10:44:59 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3L8ix9c008353 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 21 Apr 2010 10:44:59 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [OBV] Fix compilation failure inn rs6000-aix-tdep.c Date: Wed, 21 Apr 2010 08:45:00 -0000 Message-ID: <003701cae12e$fa554d40$eeffe7c0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2010-04/txt/msg00673.txt.bz2 gcc-4.1.2 chokes at cc1: warnings being treated as errors /home/muller/auto-test-gdb/gdb/gdb/rs6000-aix-tdep.c: In function 'rs6000_convert_from_func_ptr_addr': /home/muller/auto-test-gdb/gdb/gdb/rs6000-aix-tdep.c:586: warning: 'pc' may be used uninitialized in this function This is because 'pc' is initialized in a TRY_CATCH which itself consists of two while statements so that the statement after TRY_CATCH is not surely executed (at least from the gcc point of view). This compilation failure is trivially fixed by setting pc to zero first. Checked in as obvious, Pierre Muller ChangeLog entry: 2010-04-21 Pierre Muller Fix compilation warning on gcc-4.1.2. * rs6000-aix-tdep.c (rs6000_convert_from_func_ptr_addr): Initialize local variable`pc' to zero. Index: rs6000-aix-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-aix-tdep.c,v retrieving revision 1.17 diff -u -p -r1.17 rs6000-aix-tdep.c --- rs6000-aix-tdep.c 20 Apr 2010 22:38:53 -0000 1.17 +++ rs6000-aix-tdep.c 21 Apr 2010 08:43:16 -0000 @@ -583,7 +583,7 @@ rs6000_convert_from_func_ptr_addr (struc the target address itself points to a section that is executable. */ if (s && (s->the_bfd_section->flags & SEC_CODE) == 0) { - CORE_ADDR pc; + CORE_ADDR pc = 0; struct obj_section *pc_section; struct gdb_exception e;