From patchwork Thu Jul 2 20:41:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 7474 Received: (qmail 119845 invoked by alias); 2 Jul 2015 20:41:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 119831 invoked by uid 89); 2 Jul 2015 20:41:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS, UNWANTED_LANGUAGE_BODY autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 02 Jul 2015 20:41:45 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 8E6BBA91 for ; Thu, 2 Jul 2015 20:41:44 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t62KffHs026195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 2 Jul 2015 16:41:43 -0400 Date: Thu, 2 Jul 2015 22:41:40 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [obv] Fix GCC false warning Message-ID: <20150702204140.GA22592@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes 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 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 + + Fix GCC false warning. + * s390-linux-tdep.c (s390_handle_arg): Initialize VAL. + 2015-07-02 Yao Qi * 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) {