Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [OBV] Fix compilation failure inn rs6000-aix-tdep.c
Date: Wed, 21 Apr 2010 08:45:00 -0000	[thread overview]
Message-ID: <003701cae12e$fa554d40$eeffe7c0$@muller@ics-cnrs.unistra.fr> (raw)

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  <muller@ics.u-strasbg.fr>

       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;


             reply	other threads:[~2010-04-21  8:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21  8:45 Pierre Muller [this message]
2010-04-21 14:11 ` Joel Brobecker
2010-04-21 15:33   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003701cae12e$fa554d40$eeffe7c0$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox