From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24041 invoked by alias); 11 Dec 2001 19:43:06 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23655 invoked from network); 11 Dec 2001 19:41:49 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 11 Dec 2001 19:41:49 -0000 Received: from drow by nevyn.them.org with local (Exim 3.33 #1 (Debian)) id 16Dsmm-0005xB-00; Tue, 11 Dec 2001 14:41:52 -0500 Date: Tue, 11 Dec 2001 11:43:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/ob] Message-ID: <20011211144152.A22746@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <3C164DDD.5020904@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C164DDD.5020904@cygnus.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2001-12/txt/msg00310.txt.bz2 On Tue, Dec 11, 2001 at 10:18:05AM -0800, Andrew Cagney wrote: > Just FYI, > > I've checked the attached in as, er, obvious. It fixes a > -Wuninitialized warning. I agree with the "er, obvious". Would there be anything wrong with: > *************** value_fn_field (value_ptr *arg1p, struct > *** 971,983 **** > struct minimal_symbol *msym; adding = NULL to the line above? > > sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL); > ! if (!sym) > { > msym = lookup_minimal_symbol (physname, NULL, NULL); > } > - > - if (!sym && !msym) > - return NULL; > > v = allocate_value (ftype); > if (sym) > --- 972,988 ---- > struct minimal_symbol *msym; > > sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL); > ! if (sym != NULL) > { > + msym = NULL; > + } > + else > + { > + gdb_assert (sym == NULL); This assert in particular bugs me. Adding asserts that the compiler can obviously eliminate, since sym isn't volatile... -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer