From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4871 invoked by alias); 9 Jan 2012 22:33:35 -0000 Received: (qmail 4859 invoked by uid 22791); 9 Jan 2012 22:33:34 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-we0-f201.google.com (HELO mail-we0-f201.google.com) (74.125.82.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Jan 2012 22:33:21 +0000 Received: by wejx9 with SMTP id x9so166084wej.0 for ; Mon, 09 Jan 2012 14:33:20 -0800 (PST) Received: by 10.213.21.146 with SMTP id j18mr1820793ebb.11.1326148400140; Mon, 09 Jan 2012 14:33:20 -0800 (PST) Received: by 10.213.21.146 with SMTP id j18mr1820788ebb.11.1326148399906; Mon, 09 Jan 2012 14:33:19 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id m16si16999263eei.3.2012.01.09.14.33.19 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 09 Jan 2012 14:33:19 -0800 (PST) Received: from ruffy2.mtv.corp.google.com (ruffy2.mtv.corp.google.com [172.18.110.129]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id AFE362000AB for ; Mon, 9 Jan 2012 14:33:19 -0800 (PST) Received: by ruffy2.mtv.corp.google.com (Postfix, from userid 67641) id E2D791E2567; Mon, 9 Jan 2012 14:33:18 -0800 (PST) To: gdb-patches@sourceware.org Subject: [commit] fix gcc warnings Message-Id: <20120109223318.E2D791E2567@ruffy2.mtv.corp.google.com> Date: Mon, 09 Jan 2012 22:33:00 -0000 From: dje@google.com (Doug Evans) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00282.txt.bz2 Hi. Simple fix to avoid some gcc warnings. cc1: warnings being treated as errors ../../src/gdb/gdbtypes.c: In function 'safe_parse_type': ../../src/gdb/gdbtypes.c:1698: error: 'type' may be used uninitialized in this function cc1: warnings being treated as errors ../../src/gdb/varobj.c: In function 'varobj_set_value': ../../src/gdb/varobj.c:1420: error: 'val' may be used uninitialized in this function ../../src/gdb/varobj.c:1402: error: 'value' may be used uninitialized in this function 2012-01-09 Doug Evans * gdbtypes.c (safe_parse_type): Initialize type to keep gcc happy. * varobj.c (varobj_set_value): Initialize val,value to keep gcc happy. Index: gdbtypes.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.c,v retrieving revision 1.224 diff -u -p -r1.224 gdbtypes.c --- gdbtypes.c 9 Jan 2012 20:27:48 -0000 1.224 +++ gdbtypes.c 9 Jan 2012 22:29:19 -0000 @@ -1674,7 +1674,7 @@ static struct type * safe_parse_type (struct gdbarch *gdbarch, char *p, int length) { struct ui_file *saved_gdb_stderr; - struct type *type; + struct type *type = NULL; /* Initialize to keep gcc happy. */ volatile struct gdb_exception except; /* Suppress error messages. */ Index: varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.186 diff -u -p -r1.186 varobj.c --- varobj.c 9 Jan 2012 20:27:49 -0000 1.186 +++ varobj.c 9 Jan 2012 22:29:19 -0000 @@ -1359,13 +1359,12 @@ varobj_get_value (struct varobj *var) int varobj_set_value (struct varobj *var, char *expression) { - struct value *val; - + struct value *val = NULL; /* Initialize to keep gcc happy. */ /* The argument "expression" contains the variable's new value. We need to first construct a legal expression for this -- ugh! */ /* Does this cover all the bases? */ struct expression *exp; - struct value *value; + struct value *value = NULL; /* Initialize to keep gcc happy. */ int saved_input_radix = input_radix; char *s = expression; volatile struct gdb_exception except;