From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH obv] Initialize variables in i386_linux_handle_segmentation_fault
Date: Thu, 25 Feb 2016 16:08:00 -0000 [thread overview]
Message-ID: <1456416469-16334-1-git-send-email-simon.marchi@ericsson.com> (raw)
FYI, I just pushed this as obvious.
We see this error when building with gcc 4.3.
../../gdb/i386-linux-tdep.c: In function âi386_linux_handle_segmentation_faultâ:
../../gdb/i386-linux-tdep.c:399: error: âaccessâ may be used uninitialized in this function
../../gdb/i386-linux-tdep.c:399: error: âupper_boundâ may be used uninitialized in this function
../../gdb/i386-linux-tdep.c:399: error: âlower_boundâ may be used uninitialized in this function
It's a false positive, since the variables will always get initialized
in the TRY clause, and the CATCH returns.
gdb/ChangeLog:
* i386-linux-tdep.c (i386_linux_handle_segmentation_fault):
Initialize variables.
---
gdb/ChangeLog | 5 +++++
gdb/i386-linux-tdep.c | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dc12399..00af395 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-02-25 Simon Marchi <simon.marchi@ericsson.com>
+
+ * i386-linux-tdep.c (i386_linux_handle_segmentation_fault):
+ Initialize variables.
+
2016-02-25 Antoine Tremblay <antoine.tremblay@ericsson.com>
* ax-general.c (ax_reg): Call gdbarch_remote_register_number.
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 63cda45..42877da 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -396,7 +396,8 @@ void
i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
struct ui_out *uiout)
{
- CORE_ADDR lower_bound, upper_bound, access;
+ /* -Wmaybe-uninitialized */
+ CORE_ADDR lower_bound = 0, upper_bound = 0, access = 0;
int is_upper;
long sig_code = 0;
--
2.5.1
next reply other threads:[~2016-02-25 16:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 16:08 Simon Marchi [this message]
2016-02-25 16:39 ` Tedeschi, Walfred
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=1456416469-16334-1-git-send-email-simon.marchi@ericsson.com \
--to=simon.marchi@ericsson.com \
--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