From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8761 invoked by alias); 5 Dec 2006 21:37:04 -0000 Received: (qmail 8753 invoked by uid 22791); 5 Dec 2006 21:37:03 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr2.xs4all.nl (HELO smtp-vbr2.xs4all.nl) (194.109.24.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Dec 2006 21:36:56 +0000 Received: from webmail.xs4all.nl (dovemail2.xs4all.nl [194.109.26.4]) by smtp-vbr2.xs4all.nl (8.13.8/8.13.8) with ESMTP id kB5LaJGj039805; Tue, 5 Dec 2006 22:36:20 +0100 (CET) (envelope-from mark.kettenis@xs4all.nl) Received: from 163.1.150.229 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Tue, 5 Dec 2006 22:36:20 +0100 (CET) Message-ID: <24560.163.1.150.229.1165354580.squirrel@webmail.xs4all.nl> In-Reply-To: References: <20061202192351.GY3304@adacore.com> <4573EBCD.90505@de.ibm.com> <20061204182108.GA11343@adacore.com> <4575197F.7020602@de.ibm.com> Date: Tue, 05 Dec 2006 21:37:00 -0000 Subject: Re: GDB 6.5.90 available for testing (GDB 6.6 pre-release) From: "Mark Kettenis" To: "Jim Blandy" Cc: "Markus Deuling" , "Joel Brobecker" , gdb@sourceware.org User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00047.txt.bz2 > > Here's the patch I've been using for this. It'd be better to rework > the way those functions use those obstacks, but... > > 2006-12-05 Jim Blandy > > * cp-valprint.c (cp_print_value_fields, cp_print_value): > Initialize tmp_obstack, to avoid warnings. > * p-valprint.c (pascal_object_print_value_fields) > (pascal_object_print_value): Same. This is silly, at least if they are really unecessary. It's a bug in GCC and should be fixed. I mean, GCC should get better at detecting this sort of things; not give more false positives. Markus, can you file a GCC bug report for this? > > diff -rN -u old-lval/gdb/cp-valprint.c new-lval/gdb/cp-valprint.c > --- gdb/cp-valprint.c 2006-12-05 11:11:42.000000000 -0800 > +++ gdb/cp-valprint.c 2006-12-05 11:11:43.000000000 -0800 > @@ -269,6 +269,9 @@ > char *last_dont_print = obstack_next_free > (&dont_print_statmem_obstack); > int fields_seen = 0; > > + /* This isn't necessary, but it avoids compiler warnings. */ > + obstack_init (&tmp_obstack); > + > CHECK_TYPEDEF (type); > > fprintf_filtered (stream, "{"); > @@ -531,6 +534,9 @@ > int thisoffset; > struct type *thistype; > > + /* This isn't necessary, but it avoids compiler warnings. */ > + obstack_init (&tmp_obstack); > + > if (dont_print_vb == 0) > { > /* If we're at top level, carve out a completely fresh > diff -rN -u old-lval/gdb/p-valprint.c new-lval/gdb/p-valprint.c > --- gdb/p-valprint.c 2006-12-05 11:11:42.000000000 -0800 > +++ gdb/p-valprint.c 2006-12-05 11:11:44.000000000 -0800 > @@ -756,6 +756,9 @@ > struct obstack tmp_obstack; > char *last_dont_print = obstack_next_free > (&dont_print_statmem_obstack); > > + /* This isn't necessary, but it avoids compiler warnings. */ > + obstack_init (&tmp_obstack); > + > CHECK_TYPEDEF (type); > > fprintf_filtered (stream, "{"); > @@ -927,6 +930,9 @@ > = (struct type **) obstack_next_free (&dont_print_vb_obstack); > int i, n_baseclasses = TYPE_N_BASECLASSES (type); > > + /* This isn't necessary, but it avoids compiler warnings. */ > + obstack_init (&tmp_obstack); > + > if (dont_print_vb == 0) > { > /* If we're at top level, carve out a completely fresh > >