public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [obv] Fix GCC false warning
@ 2015-07-02 20:41 Jan Kratochvil
  0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2015-07-02 20:41 UTC (permalink / raw)
  To: gdb-patches


[-- Attachment #0: Type: message/rfc822, Size: 1656 bytes --]

From: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH] Fix GCC false warning
Date: Thu, 2 Jul 2015 22:39:57 +0200

At least on
	gcc-4.4.7-11.el6.i686
	./configure --enable-64-bit-bfd --enable-targets=all
GDB does not build due to:
	cc1: warnings being treated as errors
	s390-linux-tdep.c: In function ‘s390_handle_arg’:
	s390-linux-tdep.c:2575: error: ‘val’ may be used uninitialized in this function

gdb/ChangeLog
2015-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix GCC false warning.
	* s390-linux-tdep.c (s390_handle_arg): Initialize VAL.
---
 gdb/ChangeLog         | 5 +++++
 gdb/s390-linux-tdep.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97d0079..9dc21e8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix GCC false warning.
+	* s390-linux-tdep.c (s390_handle_arg): Initialize VAL.
+
 2015-07-02  Yao Qi  <yao.qi@linaro.org>
 
 	* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Fix
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 2460aa1..ec28448 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -2572,7 +2572,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
     }
   else if (s390_function_arg_integer (type) && length <= word_size)
     {
-      ULONGEST val;
+      /* Initialize it just to avoid a GCC false warning.  */
+      ULONGEST val = 0;
 
       if (write_mode)
 	{
-- 
2.1.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-02 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 20:41 [obv] Fix GCC false warning Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).