[patch/ob]
Daniel Jacobowitz
drow@mvista.com
Tue Dec 11 11:43:00 GMT 2001
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
More information about the Gdb-patches
mailing list