From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25081 invoked by alias); 2 Dec 2006 18:27:24 -0000 Received: (qmail 25063 invoked by uid 22791); 2 Dec 2006 18:27:23 -0000 X-Spam-Check-By: sourceware.org Received: from smtp109.sbc.mail.mud.yahoo.com (HELO smtp109.sbc.mail.mud.yahoo.com) (68.142.198.208) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 02 Dec 2006 18:27:15 +0000 Received: (qmail 14283 invoked from network); 2 Dec 2006 18:27:13 -0000 Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@71.146.122.56 with login) by smtp109.sbc.mail.mud.yahoo.com with SMTP; 2 Dec 2006 18:27:13 -0000 X-YMail-OSG: FZG8.ssVM1lpg18xVS0ATpFnPcT4j3glO27UMHw3c2TZMgxelMroOxoTi2NQ2nWrfy_LFuuKh0UVvG9ZEnBaPbIaiHwv..QuFrcUw_FRx.ujb1AaMPK5q0NgGpuigtlSupjFrziC Received: by lucon.org (Postfix, from userid 500) id 6B81546EEAA; Sat, 2 Dec 2006 10:27:12 -0800 (PST) Date: Sat, 02 Dec 2006 18:27:00 -0000 From: "H. J. Lu" To: GDB Subject: PATCH: Initialize tmp_obstack Message-ID: <20061202182712.GA623@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.2i 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: 2006-12/txt/msg00008.txt.bz2 Gcc 4.1 warns cc1: warnings being treated as errors /export/gnu/src/gdb/gdb/gdb/p-valprint.c: In function ‘pascal_object_print_value_fields’: /export/gnu/src/gdb/gdb/gdb/p-valprint.c:756: warning: ‘tmp_obstack.alloc_failed’ may be used uninitialized in this function This patch fixes those. H.J. ---- 2006-12-02 H.J. Lu * cp-valprint.c (cp_print_value_fields): Initialize tmp_obstack. (cp_print_value): Likewise * p-valprint.c (pascal_object_print_value_fields): Likewise (pascal_object_print_value): Likewise --- gdb/cp-valprint.c.init 2005-12-17 14:33:59.000000000 -0800 +++ gdb/cp-valprint.c 2006-12-02 10:23:21.000000000 -0800 @@ -265,7 +265,7 @@ cp_print_value_fields (struct type *type struct type **dont_print_vb,int dont_print_statmem) { int i, len, n_baseclasses; - struct obstack tmp_obstack; + struct obstack tmp_obstack = { 0 }; char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack); int fields_seen = 0; @@ -524,7 +524,7 @@ cp_print_value (struct type *type, struc struct ui_file *stream, int format, int recurse, enum val_prettyprint pretty, struct type **dont_print_vb) { - struct obstack tmp_obstack; + struct obstack tmp_obstack = { 0 }; struct type **last_dont_print = (struct type **) obstack_next_free (&dont_print_vb_obstack); int i, n_baseclasses = TYPE_N_BASECLASSES (type); --- gdb/p-valprint.c.init 2006-12-02 09:50:54.000000000 -0800 +++ gdb/p-valprint.c 2006-12-02 10:22:35.000000000 -0800 @@ -753,7 +753,7 @@ pascal_object_print_value_fields (struct int dont_print_statmem) { int i, len, n_baseclasses; - struct obstack tmp_obstack; + struct obstack tmp_obstack = { 0 }; char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack); CHECK_TYPEDEF (type); @@ -922,7 +922,7 @@ pascal_object_print_value (struct type * enum val_prettyprint pretty, struct type **dont_print_vb) { - struct obstack tmp_obstack; + struct obstack tmp_obstack = { 0 }; struct type **last_dont_print = (struct type **) obstack_next_free (&dont_print_vb_obstack); int i, n_baseclasses = TYPE_N_BASECLASSES (type);