aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2016-02-25 11:03:22 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2016-02-25 11:03:23 -0500
commit166616ce00e0c27fa3f556bcdeb908d4c0212393 (patch)
tree70f0d567ffae71dd4f9231ed8fb9d3f978939ac1 /gdb/i386-linux-tdep.c
parent678b48b7cf0bd518ebc234bda98229cc602c2a45 (diff)
downloadgdb-166616ce00e0c27fa3f556bcdeb908d4c0212393.zip
gdb-166616ce00e0c27fa3f556bcdeb908d4c0212393.tar.gz
gdb-166616ce00e0c27fa3f556bcdeb908d4c0212393.tar.bz2
Initialize variables in i386_linux_handle_segmentation_fault
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.
Diffstat (limited to 'gdb/i386-linux-tdep.c')
-rw-r--r--gdb/i386-linux-tdep.c3
1 files changed, 2 insertions, 1 deletions
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;